Moving to a new activity without completing the current one

  • 12 April 2006
  • 2 replies
  • 0 views

Badge +1
I'm not sure how to design a workflow that accomplishes the following:

Let's say I have one main task that has two subtasks. I also have two users. In my workflow I have an activity 'AssignTasks' with a default client event (ASPX page) where an administrator assigns one subtask to each user. I then have a 'Perform Tasks' activity with a default client event (ASPX page) that creates a slot for each destination. Below that activity I have another activity called 'Review Task' with a client event (ASPX page) where the manager can review the subtask that ONE user has completed.

Now to the issue:
I want the workflow to move down to the 'Review Tasks' activity when ONE of the users has completed their subtask, but the 'Perform Tasks' still have to be available so the second user can complete his subtask. (I also want the manager to be able to send the subtask back for re-work to the 'Perform Tasks' activity but that is a separate issue at the moment!)

The only way I have found to get the flow to go down to the 'Review Task' operation is by calling finish on the WorklistItem object when a user has completed his subtask. The problem is then that the activity is tagged as complete and user 2 gets an error when submitting his subtask. I need to keep the 'Perform Tasks' activity open until all users have finished their subtasks!

Any help would be greatly appreciated

Christian

2 replies

Badge +6
Hi Christian,

This is not possible at all -> Before the process can continue down the line to the following activity the Succeeding rule has to evaluate to 'True' This is not possible if you have one client event that is still active. (I take you have 'Destination Rule' set to 'All True')

The easiest way to achieve this is to split the events into seperate activities so that only one destination is set on each. This will mean that you will also require a seperate activity for the 'Review Task'. The task can then be sent between the users without any issues based on line rules.

Another way to achieve this is to use some intelligent redirection:

Create the ASPX page to include two panels. The one panel is displayed when some datafield (e.g. Review) is 'False' and the other when it is true. The 'false' panel is displayed when the 'Perform Task' user opens the form. This user completes his task and submits it. On the submit a redirection is made to the 'Review Task' user. Before calling the redirect method in the code you need to change the 'Review' datafield to 'True' and 'update' the process with this value.

When the 'review' user now opens the workitem (i.e. ASPX page), the 'Review' value is evaluated and the other panel is displayed.
This user can either 'Approve' the item (with code to finish the workitem) or 'Decline' (with code to redirect back to the original user but also changing the 'Review' value to false again in order to display the correct panel.)

Obviously the original 'Perform Task' user's name must be saved in an Activity Datafield in order to do successful backwards redirection.

This last option will not look so slick in the reports though and no notification emails can be set up...

Hope this helps...
Badge +1
Thanks for your tips Conradk2 and sorry for the late comeback.

I have partially solved the solution by creating a separate 'PerformTask' process and calling it from the main process with synchronous IPC calls. I implemented it by keeping the 'Perform Tasks' activity in the main process and adding a IPC event to it. This now means that for each destination (user1 and user2) the IPC event fires and creates a new instance of the 'PerformTask' process. Both users can now work on their tasks and managers can approve it or sent it back for rework. The mainprocess will not continue until all instances of the 'PerformTask' process has finished.

cheers

Reply