Skip to main content

I have a fairly standard Create/Review/Approve/Complete process used to distribute tasks to our users. 


What I am attempting to do is develop a second process which can be used to update the process above after it has been sent to the users worklist.  These updates need to follow the same approval process as the original, and once "approved", the update would ideally modify the original process instance. 


Depending on the type of update being attempted, this can be as simple as updating a data field. In some cases, however, I need to restart or redirect the original process.  For example, if a task was assigned to the wrong group, we need to update the assignment field and then restart so that it is directed to the correct users.


I had thought I might be able to use the ProcessInstance.GoToActivity to do this, but so far I can not find a way to access that function from outside the current process instance. 


I have tried using both SourceCode.Workflow.Client and Management to gain access to the other process instance, but neither seems to give me access to the GoToActivity call.  Is there a way to achieve this?

I've been playing around with something similar, try this to find your process instances (by folio) via Management and then using 'goto':


 


SourceCode.Workflow.Management.WorkflowManagementServer wms = new SourceCode.Workflow.Management.WorkflowManagementServer();
wms.Open(K2.StringTableg"Workflow Management Server"]);

foreach (SourceCode.Workflow.Management.ProcessInstance pi in wms.GetProcessInstances(K2.ProcessInstance.Folio))
{
wms.GotoActivity(pi.ID, "Wherever");
}

wms.Connection.Close();


This worked like a charm.  Thanks for the help!


Reply