public void BranchProcessSimulation() { IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithBranchTemplate(); WfSimulationParameters simulationParameters = new WfSimulationParameters(); WfSimulationResult result = WfSimulator.StartSimulation(processDesp, new WfSimulationParameters()); Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString()); while (result.ProcessStatus != WfProcessStatus.Completed) { result = WfSimulator.MoveToSimulation(result.ProcessID, simulationParameters); Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString()); } }
public void ConditionProcessSimulation() { IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithCondition(); WfSimulationParameters simulationParameters = new WfSimulationParameters(); simulationParameters.Variables.Add(new WfVariableDescriptor("Amount", "10000", DataType.Int)); WfSimulationResult result = WfSimulator.StartSimulation(processDesp, new WfSimulationParameters()); Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString()); while (result.ProcessStatus != WfProcessStatus.Completed) { result = WfSimulator.MoveToSimulation(result.ProcessID, simulationParameters); Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString()); } }
public void SimpleProcessSimulation() { IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptor(); processDesp.Activities["NormalActivity"].Resources.Add(new WfUserResourceDescriptor((IUser)OguObjectSettings.GetConfig().Objects["approver1"].Object)); processDesp.Activities["NormalActivity"].Resources.Add(new WfUserResourceDescriptor((IUser)OguObjectSettings.GetConfig().Objects["approver2"].Object)); WfSimulationParameters simulationParameters = new WfSimulationParameters(); WfSimulationResult result = WfSimulator.StartSimulation(processDesp, new WfSimulationParameters()); Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString()); while (result.ProcessStatus != WfProcessStatus.Completed) { result = WfSimulator.MoveToSimulation(result.ProcessID, simulationParameters); Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString()); } }
public WfSimulationResult MoveToSimulation(string processID, string simulationParametersJson) { return(WfSimulator.MoveToSimulation(processID, JSONSerializerExecute.Deserialize <WfSimulationParameters>(simulationParametersJson))); }