コード例 #1
0
        public static WFEvent CreateProcInst(string PID, string PIID, string PIName, string workObjectID,
                                             string superPIID, bool startImmediately)
        {
            IWFWorkflowService svc = Common.GetWorkFlowAPI();
            string             processDefinitionName = "EmployeeOnboardProcess";

            // get UUID of released process definition
            string processDefinitionID = svc.GetReleasedPID(processDefinitionName);

            // assign UUID of process instance
            string processInstanceID = UUID.GetID();

            // process instance name that has to be unique within process definition ID
            string processInstanceName = string.Format("{0}-{1}", processDefinitionName, DateTime.Now.Ticks);

            // work object ID
            workObjectID = UUID.GetID();

            // create process instance
            WFEvent E = svc.CreateProcInst(PID, PIID, PIName, workObjectID, null, true);

            return(E);
        }