When setting up a sequence flow condition that is based on an action, it gives you the option to set "equal to" or "not equal to", and then you can select from an "Action Button List". If an action button label is the same on multiple user tasks, how does the process know which button action to evaluate?
Question
Question
Answer
That's a much better idea. With one minor edit, that code should do it:
$(document).ready(function () { $('.Reject').click(function () { $('.approvalField input').val('Reject'); }); });
Replies
There should only be one task leading to a splitting gateway, so the gateway will refer to that task. If multiple tasks lead to a gateway (a merging scenario), only one outflow path can be specified, so there won't be any conditions. You cannot have a gateway that merges and splits.
Eric, that is correct.
Take the following into consideration though. If you look at the following screenshot of one our processes in question, you can see after the HR Director it goes to an inclusive gateway that has the ability to go to 4 different user tasks. Each of those user tasks have the ability to accept or reject the form. We then use a parallel gateway to merge them and then an exclusive gateway to make a decision of where to go next, based off of the decisions from the previous 4 user tasks. How does the process know which button action to evaluate if I cannot specify a user task associated with a button action?
The Approved or Rejected? exclusive gateway does not have access to the decisions from those user tasks. Depending on what the logic for this gateway is, you might be able to do it by setting field values during each user task.
For example, you might have a hidden checkbox field. When a user clicks the approve button, you could use JavaScript to select a checkbox and then, depending on the logic you want, have it fill another field when several checkboxes are checked. Then you could use this filled field with your exclusive gateway instead of relying on the previous user task actions.
Here's a little JavaScript that will select a checkbox (given the check CSS class) when the user clicks the approve button. You can modify this as necessary (you'll probably need to change the value for the checkbox) to fill out the rest of the logic.
$(document).ready(function () { $('.Approve').click(function () { $('.check input[value="choice_1"]').trigger('click'); }); });
Why does it not have access to the decisions from those user tasks? When I go to the Path Conditions for Approved or Rejected? I am able to choose the correct responses from the drop-down list.
You can see the correct responses from the drop-down list, but the gateway will only use those conditions to evaluate a task immediately before the gateway. Showing those options might be misleading, as Forms will not evaluate those other user tasks.
I'll discuss this with the rest of the Forms team to see if we can make this part of the Process Modeler more straightforward.
I would agree that is very misleading. Are there any plans for future versions to be able to add functionality like what I was trying? I would imagine having people basically vote on something and then looking at the results to make a routing decision is pretty normal.
We are planning to store individual user task actions in variables that can be referenced later in the process, but this enhancement will not be in Forms 9.2.
Eric, looking at the jQuery sample code you posted I have a question. The form could be assigned to 5 users at the same time. See screenshot below. If they are using the Approve or Reject buttons and the jQuery is used to fill a checkbox, wouldn't they all fill in the same checkbox?
What would happen if they were all supposed to fill the same checkbox when someone rejected the form and two people rejected it. Would it check and then uncheck the box or notice that it was already checked and leave it alone?
I think you'd want the checkbox field to have multiple checkboxes, one for each reviewer. You could alter the code so that, each time a reviewer clicks Approve, it checks the next available box. Then, if all the boxes are checked, you could fill a different field and use that field's value in your gateway's path conditions.
That might look something like this:
$(document).ready(function () { $('.Approve').click(function () { $('.check input:checkbox:not(:checked)').first().trigger('click'); if ($('.check input:checkbox').last().is(':checked')) { $('.approvalField input').val('Approved'); } }); });
The checkbox field has the check class; the field that gets filled when all the checkboxes are checked has the approvalField class.
Eric, thank you for helping with this. I thought what you suggested was going to work until I realized that the "Additional Routing" gateway is inclusive, so it could go to any number of the people in the list or none of them.
While I was writing this though I figured out the solution. Instead of looking at the Approve button, I am going to look at the Reject button. If it is clicked, then fill in the text field with Rejected. If any one of the assigned users reject it, it should go down the denial path, that should work.
I would imagine to accomplish this the code would look like the following?
$(document).ready(function () { $('.Reject').click(function () { $('.approvalField input').val('Reject'); } }); });
That's a much better idea. With one minor edit, that code should do it:
$(document).ready(function () { $('.Reject').click(function () { $('.approvalField input').val('Reject'); }); });