public virtual void testCatchErrorThrownBySignalOfDelegateExpression() { IVariableMap variables = ESS.FW.Bpm.Engine.Variable.Variables.CreateVariables().PutValue("myDelegate", new ThrowErrorDelegate()); string pi = runtimeService.StartProcessInstanceByKey("testProcess", variables).Id; Assert.True((bool)runtimeService.GetVariable(pi, "executed")); Assert.IsNull(runtimeService.GetVariable(pi, "signaled")); IExecution serviceTask = runtimeService.CreateExecutionQuery(c => c.ProcessInstanceId == pi && c.ActivityId == "serviceTask").First(); Assert.NotNull(serviceTask); runtimeService.SetVariables(pi, ThrowErrorDelegate.throwError()); runtimeService.Signal(serviceTask.Id); Assert.True((bool)runtimeService.GetVariable(pi, "executed")); Assert.True((bool)runtimeService.GetVariable(pi, "signaled")); ITask userTask = taskService.CreateTaskQuery(c => c.ProcessInstanceId == pi).First(); Assert.NotNull(userTask); Assert.AreEqual("userTaskError", userTask.TaskDefinitionKey); taskService.Complete(userTask.Id); }
public virtual void testCatchErrorThrownByExecuteOfAbstractBpmnActivityBehavior() { string pi = runtimeService.StartProcessInstanceByKey("testProcess", ThrowErrorDelegate.throwError()).Id; Assert.True((bool)runtimeService.GetVariable(pi, "executed")); Assert.IsNull(runtimeService.GetVariable(pi, "signaled")); ITask userTask = taskService.CreateTaskQuery(c => c.ProcessInstanceId == pi).First(); Assert.NotNull(userTask); Assert.AreEqual("userTaskError", userTask.TaskDefinitionKey); taskService.Complete(userTask.Id); }