Skip to main content

Hello


I've attached a screenshot showing the workflow I've been given.


What are are looking to do is to start a process off and have two activities. "Wait for costs" is a process which just sits there until a user enter costs from a supplier which are then validated. If they are not valid, the data is sent to their manager to discuss the entered costs with the supplier.


If no costs have arrived after one week, we need to generate a worklist item to chase the supplier for the costs. If no costs are given after this week, the chase task is repeated a week later. Currently I have a "start rule" on the "Escalate no costs" activity which reads as: 


bool haveCosts = Convert.ToBoolean(K2.ProcessInstance.DataFieldsd"HaveCosts"].Value); 
if (haveCosts == false)
{
          K2.SetStartRule(1, 0, 0, 0);      


What I would like to do is if costs are entered before the initial chase task I'd like to completely stop the "Escalate No Costs" activity.


I have tried a few methods to do this, but nothing appears to be working. Any help would be appreciated!


Cheers!


16653iD15D1499E116214D.gif

Have you tried the GotoActivity method?


You could try adding a new activity between "Wait for Costs" and "Validate Cost Entry". Within connect lines as follows:


Wait for Costs -> NEW ACTIVITY


NEW ACTIVITY -> Validate Cost Entry


Within the New Activity create a Server Event.  Within the code of this server event use a GotoActivity method.  It should look like:


   K2.GotoActivity("Validate Cost Entry");


The GotoActivity will force all open activity instances in this process instance (in this case the "Escalate no cost" activity) to shut down and then the activity in the method call is started up.


 


Reply