Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add If task #222

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Add If task #222

merged 2 commits into from
Aug 13, 2024

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Aug 13, 2024

Using the If Task

In the WorkGraph user interface, the If Task is visually represented as an "If Zone." This zone encapsulates all its child tasks, which are executed based on the defined conditions.

  • Conditions: The If Zone includes a conditions socket, which determines when the tasks inside the zone should be executed.
  • Invert_condition: If this input is True, it will invert the conditions.
  • Task Linking: Tasks located outside the If Zone can be directly linked to tasks within the zone, allowing for dynamic workflow adjustments based on conditional outcomes.

Example

if2 = wg.add_task("If", name="if_false",
                        conditions=condition1.outputs["result"],
                        invert_condition=True)
if2.children.append("multiply1")

@superstar54 superstar54 mentioned this pull request Aug 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.56%. Comparing base (5937b88) to head (b1845ce).
Report is 23 commits behind head on main.

Files Patch % Lines
tests/test_if.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
+ Coverage   75.75%   76.56%   +0.80%     
==========================================
  Files          70       71       +1     
  Lines        4615     5039     +424     
==========================================
+ Hits         3496     3858     +362     
- Misses       1119     1181      +62     
Flag Coverage Δ
python-3.11 76.56% <98.43%> (+0.89%) ⬆️
python-3.9 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@superstar54 superstar54 merged commit f003c34 into main Aug 13, 2024
8 checks passed
@superstar54 superstar54 deleted the feature/add_if_task branch August 13, 2024 19:21
@superstar54 superstar54 linked an issue Aug 14, 2024 that may be closed by this pull request
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try switch node for if.
2 participants