Problems with XOR-Gatewa

1
0
-1

Hi,

I'm working on a project and can't get past my xor gateway.
I thought of something like a script. I use status.text, which i would like to use in if status = accepted then isApproved.boolean = true, so take Approved-line. Else use default-line.

Can anyone help me?

Thanks

Comments

Submitted by Dibyajit.Roy on Wed, 03/01/2017 - 14:47

Hi
I was once faced with a scenario using XOR gates. Based on a condition, the Flow would be different.
I mapped 3 different tasks on each arm of the XOR gateway.
I marked 2 arms of the XOR with YES and the Final Arm with NO.
Finally I used a Simple if else statement to Select the Correct flow.
Here is my Code.
( I stored the Users Choice in a Pool variable called decision)
if(decision == "Planned")
{
return "YES";
}
else if(decision == "Unplanned")
{
return "YES";
}
else if(decision == "Archive")
{
return "NO";
}
This piece of code was added to each arm of the gateway.
Hope this helps.

Submitted by max.schmidt on Wed, 03/01/2017 - 15:21

hmm, but then I still need a boolean.
Because a boolean is expected.

Submitted by Dibyajit.Roy on Wed, 03/01/2017 - 15:38

Hi
If you return a yes and the arm is marked as yes,then its true condition.
Similarly if I mark the arm as planned and just use the variable.value.
If variable.value is planned then automatically its true condition.
The reason i used a script is because of multiple conditions.
Incase of just 2 outcomes,directly assign the variable as condition and map the arm as per the word against which u need to check.

1 answer

1
0
-1
This one is the BEST answer!

Hi,
You don't need to use a boolean variable to do that :)

Just check if your status obejct equals the value.

You can try in your script :

return "accepted".equalsIgnoreCase(status);

--> equalsIgnoreCase returns true if accepted=status
--> I put the variable 'status' in second to avoid NullPointerException

Cheers

Comments

Submitted by max.schmidt on Thu, 03/02/2017 - 12:52

Needed to delete transition and make a new one, but after that it works.

Thanks a lot.

Notifications