public string CreateInstance(string nodeID, string resource, WorkflowMode mode) { string instanceID = Guid.NewGuid().ToString(); string sql = "INSERT INTO T_INSTANCE(InstanceID,RelationshipID,State,Resource,Mode) VALUES(@InstanceID,@RelationshipID,@State,@Resource,@Mode)"; base.Connection.Execute(sql, new { InstanceID = instanceID, RelationshipID = nodeID, State = WorkflowInstanceState.Running.ToString(), Resource = resource, Mode = mode.ToString() }); return(instanceID); }
public string CreateInstance(string nodeID, string resource, WorkflowMode mode, Action <string, object> execute) { string instanceID = Guid.NewGuid().ToString(); execute(ResourceManage.SQL_WORKFLOW_INSTANCE_INSERT, new { InstanceID = instanceID, RelationshipID = nodeID, State = WorkflowInstanceState.Running.ToString(), Resource = resource, Mode = mode.ToString() }); return(instanceID); }