Methods / Methods for Activity Instances |
Web Services
Rolls back a process instance according to a specified instruction. The class WFPartialRollbackInstructionis used to specify detailed information about the instruction.
public virtual WFEvent RollbackActivityInsts(WFPartialRollbackInstruction instruction)
Name | Description |
---|---|
instruction |
WFEvent object that provides the status of the transaction. The possible statuses are:
//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(); instruction.PartialRollbackUnits = new WFPartialRollbackInstruction.PartialRollbackUnit[] {unit1,unit2}; try { //Rolling back the activity instance WFEvent evt = workflowService. RollbackActivityInsts(instruction); } catch (Exception ex) { Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex)); }
4.6 and higher