Exemple #1
0
        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);
        }
Exemple #2
0
        /// <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);
        }