You are viewing limited content. For full access, please sign in.

Question

Question

Setting Sequence Flow Condition Based on Action Question

asked on June 19, 2014

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?

0 0

Answer

SELECTED ANSWER
replied on July 16, 2014 Show version history

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');
    });
});

 

0 0

Replies

replied on June 19, 2014 Show version history

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.

0 0
replied on June 20, 2014 Show version history

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?

 

0 0
replied on June 30, 2014

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');
    });
});

 

0 0
replied on June 30, 2014

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.

0 0
replied on June 30, 2014

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.

0 0
replied on June 30, 2014 Show version history

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.

0 0
replied on June 30, 2014

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.

0 0
replied on July 8, 2014

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?

 

0 0
replied on July 9, 2014 Show version history

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.

1 0
replied on July 16, 2014 Show version history

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');
      }
    });
});

 

0 0
SELECTED ANSWER
replied on July 16, 2014 Show version history

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');
    });
});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.