conditionals using ifbegin/ifend in APEX

   769   6   2
User Avatar
Member
357 posts
Joined: 11月 2015
Offline
How does conditional statements in APEX work using the ifbegin and ifend? there is no condition output on the ifbegin that would drive the logic and the ifend seems like it's just doing a passthrough of its inputs. How does it work?
hou.f*ckatdskmaya().forever()
User Avatar
Member
280 posts
Joined:
Offline
like this...

Attachments:
Screenshot 2024-03-10 133620.jpg (54.2 KB)

User Avatar
Member
357 posts
Joined: 11月 2015
Offline
patar
like this...
Thanks @patar, this part I got, but I now realize that if nothing is happening between the begin and end block it will just passthrough the data regardless of the result of the condition. My thought process was that I could feed through 2 inputs into the begin block, plug the begin output of those into the end block and then that would have one output that depends on the result of the condition lol.
hou.f*ckatdskmaya().forever()
User Avatar
Member
7756 posts
Joined: 7月 2005
Offline
Maybe you're thinking of a TwoWaySwitch? For IfBegin/IfEnd blocks, the graph enclosed within them are only executed if the condition into the IfBegin is true.
User Avatar
Member
280 posts
Joined:
Offline
i guess make 2 if loops? one for true one for false
User Avatar
Member
12 posts
Joined: 5月 2014
Offline
you have to add "not" node to do the else condition, i had headaches swapping variables inside if block, i ended up just creating a new block and "not" node to process those.
User Avatar
Member
7756 posts
Joined: 7月 2005
Offline
Maybe what we're missing is an IfElse node? So for single If blocks, you would insert the IfElse node right before the IfEnd and then you put all the stuff you want when the condition is False in between the IfElse and IfEnd nodes. The only question with this approach is whether the values you use inside the else block need to be connected in from the IfBegin or not.
  • Quick Links