Methods / Methods for Activity Instances |
Rolls back a process instance according to a specified instruction. The class WFPartialRollbackInstructionis used to specify detailed information about the instruction.
WFEvent object that provides the status of the transaction. Possible statuses are Success, Failed, and Sent.
//Sample for partial rollback IWFWorkflowService svc = GetWorkflowService(); // PartialRollback unit WFPartialRollbackInstruction.PartialRollbackUnit unit1 = new WFPartialRollbackInstruction.PartialRollbackUnit(); unit1.DestinationActivityInstanceID = ... // destination activity instance ID unit1.SourceActivityInstanceIDs = new string[] { ... }; // array of source activity instance ID WFPartialRollbackInstruction.PartialRollbackUnit unit2 = new WFPartialRollbackInstruction.PartialRollbackUnit(); unit2.DestinationActivityInstanceID = ... // destination activity instance ID unit2.SourceActivityInstanceIDs = new string[] { … }; // array of source activity instance ID WFPartialRollbackInstruction instruction = new WFPartialRollbackInstruction(); try { //Rollbacking the activity instance WFEvent evt = workflowService. RollbackActivityInsts(instruction); } catch (Exception ex) { Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex)); }