Parallel Approval ending workflow when Rejected

  • 5 January 2016
  • 2 replies
  • 2 views

Badge +1

Hi there,

 

I'm currently working on a solution in K2 for Visual Studio.

 

General Overview of problem:

I have a SmartObject Cleint Event in which multiple approvers have been assigned from a SmartObject. I have the destination users setup as Plan Per Destination, Create a Slot for Each, and Resolve all roles and groups to users. This part seems to be working fine. All of the desired users are being assigned a task.

 

There are only two Actions and Outcomes. Approve or Reject. If All Slots Approve then it goes down the approval path. If At Least One Rejects, it will go down the reject path.

 

The problem I'm experiencing is that if one of the destination users selects Reject, the workflow still continues down the Approved path, but more interestingly, it also completes the entire workflow. The entire workflow comes to a halt and is marked as completed even if there are subsequent events/actions.

 

In addition, whenever selecting Approve, it seems to work.

 

Workspace

I've looked at the completed workflow in Workspace and it's showing that the Action is Rejected. In addition, the Outcome is marked as Rejected. (You can see in the background of the image that the workflow is proceeding through the Approve path)

 

14518iC46794DA690DC117.png

 

Form

Here's the UI for the SmartForm. A simple click of the button will action the Approved action and the reject button will action the Rejected action.

11311iAF438D2B62D5B166.png

 

If anyone can give me any additional insight on what I can try to resolve this issue, that would be much appreciated. Thanks for the help in advance!


2 replies

Badge +13

You need to show the picture of Configure Outcomes for the Reject outcome.

It's not meeting the rule you have defined there that's why it ended.

 

Do you have:

At Least 1 of [Action Result] = Reject

 

Also put some code in Process Finish rule to throw exception to prevent unanticipated premature completion of request.

Add completion flag at the process ending points and check for the flag in Process Finish rule.

Badge +1

Hello again,

 

I believe I have found the problem with the workflow.

 

So when I was constructing the workflow, I have two seperate approval tasks both with an Approval outcome and a Reject outcome. When you add another Outcome that has the same name as another outcome, K2 will generall append a 1 to the end of the name of the line rule that handles the logic. For example, Approved and Approved1. For some reason, K2 appended the number 1 to my second Approve outcome (Approve1) and not to the Reject outcome. This meant that the first and second tasks both had an outcome with the exact same name (Rejected and Rejected). This is what was causing K2 to get confused and ultimatley move down the approve path and complete the workflow.

 

Lesson Learned

Ensure that each line rules has a unique name assigned to it.

 

Thanks for the reply PeterYao!

Reply