activity variable
Subscribe to the event of the activity type, and then read or operate the activity variables in the callback method.
//run a process instance to next step
IWorkflowService wfService = new WorkflowService();
var wfResult = wfService.CreateRunner(runner.UserID, runner.UserName)
.UseApp(runner.AppInstanceID, runner.AppName, runner.AppInstanceCode)
.UseProcess(runner.ProcessGUID, runner.Version)
.NextStep(runner.NextActivityPerformers)
.IfCondition(runner.Conditions) //condition on the transiton
.Subscribe(EventFireTypeEnum.OnActivityExecuting, (delegateContext, delegateService) => {
if (delegateContext.ActivityCode == "Task1")
{
delegateService.SaveVariable(ProcessVariableTypeEnum.Process, "name", "book-task1");
delegateService.SaveVariable(ProcessVariableTypeEnum.Process, "amount", "50");
}
return true;
})
.Run();