Page 1 of 1

Routing Rule keeps reseting to 1

Posted: Wed May 16, 2018 12:47 am
by pocket
I have an exclusive gateway that keeps resetting to the value of 1 for both options.

We have a process where 3 tasks that point to an exclusive gateway.
From the gateway there are two outcomes, an end email event or another task. This is decided on the value of a boolean in the dynaforms.

variable: candidateApproved
type: Boolean
Options: 'Approved' for true and 'Denied' for false

The routing rule or the gateway is:
Action condition: @@candidateApproved==1
Denied condition: @@candidateApproved==0

So after We save and then run the form all tasks get directed to the next task whether they have been approved or denied.

Am I missing a step somewhere to get this to work?

Thanks.

Re: Routing Rule keeps reseting to 1

Posted: Wed May 16, 2018 11:54 am
by amosbatto
What is the value of the variable in the debugger? Your variable is probably being transformed to a value which isn't a boolean, such as an array if set by a checkbox or a string if set by a dropdown.

How are you setting the variable? With a checkbox, dropdown, radio button or trigger?

Re: Routing Rule keeps reseting to 1

Posted: Wed May 16, 2018 12:21 pm
by amosbatto
For example, if you are using a checkbox to set your candidateApproved variable, then you should use conditions like this:
empty(@=candidateApproved) or @=candidateApproved[0] == 0

!empty(@=candidateApproved) and @=candidateApproved[0] == 1


Use empty() because it will check whether the variable has been set (in case the user used the Steps menu to skip the Dynaform) and use @= to access the variable as an array. If you use @@, then you are converting the variable into a string, so it is transformed from array(0) or array(1) to "Array".

Re: Routing Rule keeps reseting to 1

Posted: Wed May 16, 2018 7:36 pm
by pocket
In the debugger it still seems to be listed as a boolean.
Debugger.JPG
view from the debugger
Debugger.JPG (12.58 KiB) Viewed 3772 times
It's being set by radio button

Re: Routing Rule keeps reseting to 1

Posted: Thu May 17, 2018 4:54 pm
by amosbatto
I don't understand why you are having a problem, but try using the label variable in your conditions, like this:
@@candidateApproved_label == "Approved"

@@candidateApproved_label != "Approved"

Re: Routing Rule keeps reseting to 1

Posted: Thu May 17, 2018 5:00 pm
by amosbatto
The only way that I can imagine a variable changing its value is if you try to open two cases at the same time in the same web browser. When there are two case opens in the same web browser, then it is possible for the variables from the second case to overwrite the variables in the first case. There is an option in the Enterprise Edition to only allow users to open ProcessMaker in one tab/window to prevent this problem.
See: http://wiki.processmaker.com/3.2/faq#multiple_cases

Re: Routing Rule keeps reseting to 1

Posted: Thu May 17, 2018 11:06 pm
by pocket
I've found that the routing rule will remain there if only 2 links go into the gateway, and as soon as a third or more occurs it panics and resets sending all traffic one way.

I've introduced a new gateway that does nothing before it heads to the important one which has fixed the problem.

Thanks for your help.

Re: Routing Rule keeps reseting to 1

Posted: Fri May 18, 2018 6:18 pm
by amosbatto
What you are describing is very strange. Would you mind posting your process? I would like to examine your process to determine if it is a bug in PM.

Re: Routing Rule keeps reseting to 1

Posted: Wed May 23, 2018 1:57 am
by pocket
Hi Thanks for the responses.

Unfortunately my employer won't let me post the code :(