How to bring a completed workflow back to active again?

  • 1 September 2011
  • 10 replies
  • 6 views

Badge +3

Hi,


In the organization where I work have around 15 applications using K2 Blackpearl workflows for their business needs. Most of the time when a support request comes to me I have someways to repair the errored workflows, but most of the time I have to use Go To activity option to refresh certain activities. Once in a while if the line rules doesn't qualify and if there is no way for the workflow to find a satisfied line it may abruptly end there and go into complete status. As the workflows are on production the business guys don't like to hear that they need to recreate the workflow instance again and again it has to go all the way to complete there approvals.


So it is inconvenient to deal this kind of situations. So is there a way to bring back the completed workflows to Active? so that they can be resumed from where they were ended.


Thanks,
Nivas_V


10 replies

Badge +9

Hi Nivas_V.


First of all, I'd focus on making sure your process definition doesn't allow for situations where lines are not mutually exclusive.  Thus it is important to revisit the process logic and make sure there are no ways that a process instance can "just end" due to meet satisfying any of the Line Rules.


With that being said, there is no automatic way to restart a completed process.  However a utility could be built that locates this process instance within the K2 reporting database (K2ServerLog) then determines all the data and/or XML fields associated with it and the last step it was in, then the utility could use the K2 API (SourceCode.Workflow.Client) to start a new process instance, copy in the data accordingly and then use the SourceCode.WorkflowManagement API to issue a GotoActivity to the appropriate step in the new instance.


HTH.

Badge +3

Thanks alot for the reply Bob.


You are right we should not write the logic to fail the line rules so that the worklow ends abruptly. But the situations will be like when we play with GO TO option to move back and forth from one step to other some times there are chances that the DataFields or someother data source may still having the data which was captured during previous steps. So as the data may not refresh when we move back to someother step using GO TO the workflow may end in the middle. Anyway we will see any other options to see the workflow will alyways be active until it reaches its final acticity.


I agree with your suggestion to consider moving data from K2Server Log. Do you have anything more or less smilar tool in place through which I can play around and build this?. If you have any and could share me that would be a great help.


Thanks again Bob for the quick reply!!!


Nivas_V


 

Badge +9

Unfortunately I don't have anything handy here to share.

Badge +13

We have the same problem.


We have recently started to modify a process to include an "Error" activity, and in each activity's server event we duplicate the logic in the routing lines (I am using K2 .NET 2003 but should be applicable to BP if you are having the same issue).


If none of the routing line's logic satisfies then use GotoActivity to "Error" activity (which notifies Workflow Admin).   From there you have a chance to modify the data and do a manual GotoActivity so that the process does not come to an unexpected stop.    This is a bit ugly since you have to keep the logic in sync between the routing lines and the server event that checks for it, but typically there is not a constant change with a process.


I think this is a fundamental problem to all workflow processes and would like to see BP to built in something to address this issue.


The simplest way is to only allow activities without lines to end.   Workflow engine checks for all the lines and if none of them executes, set it to an Error status.   The process exception code that I have will notify the workflow admins.   This enforces the practice of building workflow process with a clear ending activity.    For backward compatibilities, the default will work the old way and there can be a checkbox to mark that the activity cannot end if none of the lines is executable.  Workflow engine only verifies the lines when this checkbox is checked.


This would be a very useful feature to have!!

Badge +10

That is great feedback peter.  Can you log this as an official feature request via the portal. You can go to the portan, then under support select the feedback option. and for feedback type select feature reqeust. Then we can log it and officially track it.


 


Thanks!

Badge +3

Thanks alot Peter. That was really a nice suggestion to add a feature for Blackpearl workflows. As you said this feature will really help lot of people and we can comfortably use Goto Activity. Regarding adding a server event to check the lines, I think you are right that is the only posisble way I can see to avoid this issue. We will start looking into this.   Thanks alot again!!!

Badge +13

You're welcome!   I did add to the feature request at the Support portal.


Is there a way to see all feature requests (also from other customers), and we can increase the vote on it to increase its priority?

Badge +10

Just a suggestion. Maybe you can implement into your rocesss where it could end put in a delay using a place holder activity. Just set the delay to how ever many days, depending on the likelyhood of the process needing to make active again.

 

Badge +13

Using this feature, set a process data variable at the end of your process activity, and have this rule check for Y, if not set to Y then GotoActivity to an Error activity to keep the workitem alive.

 

http://help.k2.com/helppages/k2blackpearlUserGuide4.6.7/webframe.html?Finish_Rule_Exception.html

 

Badge +5

Was the feature ever implemented?

 

We had a workflow complete before we were ready, and would like to reset it back a couple of steps. Is there a way to bring completed workflows back to active?

 

Any help would be greatly appreciated.

Thanks,

Danny

 

Reply