public override string ToString() { return(Jsonizer.ToJsonString(this)); }
public string StartProcess(string definitionId, Dictionary <string, object> inputData) { string ret = null; RunProcessTransaction(this.DefaultPersistenceMode, ps => { var pd = this.GetProcessDef(definitionId); var pscript = this.GetProcessScriptRuntime(definitionId); string instanceId = Guid.NewGuid().ToString("N"); ProcessInstance pi = new ProcessInstance { InstanceId = instanceId, ProcessDefinitionId = definitionId, ProcessInstanceId = instanceId, TaskId = pd.Body.Id }; pi.Activate(ps, pd, pscript); ps.TaskPersister.SaveNew(pi); log.Info("\n --- Created process {0} instance {1}. Data: {2}", pi.ProcessDefinitionId, pi.InstanceId, Jsonizer.ToJsonString(inputData)); pi.Enable(inputData); pi.Deactivate(); ps.TaskPersister.Update(pi); ret = pi.InstanceId; }); return(ret); }