public int StartProcInstance(InstParam instance) { int result = 0; using (var client = new K2Client(_currentUser)) { result = client.StartProcessInstance( instance.ProcName, instance.Folio, instance.DataFields, Convert.ToInt16(instance.Priority)); } return(result); }
/// <summary> /// Start specific process instance /// Return [ProcInstId] /// </summary> /// <param name="instance">The process instance</param> public int StartProcessInstance(InstParam instance) { int procInstId = 0; if (instance == null) { throw new ArgumentException("Process Instance parameter is null object."); } using (Connection conn = GetWorkflowClient()) { var procInst = CreateInstance(instance.ProcName, instance.Folio, instance.DataFields, instance.Priority); conn.StartProcessInstance(procInst); procInstId = procInst.ID; } return(procInstId); }