core functions for process execution
Example #1
0
        protected override void Execute(CodeActivityContext context)
        {
            IProcessStore processStore = StoreHandler.getProcessStore(context.GetValue(cfgSQLConnectionString));
            ITaskStore taskStore = StoreHandler.getTaskStore(context.GetValue(cfgSQLConnectionString));
            P_WorkflowInstance creatorinstance = processStore.getWorkflowInstance(context.GetValue(WFId));

            processStore.updateWorkflowInstanceEndState(creatorinstance.Id, context.GetValue(IsEndState));

            if (processStore.hasProcessEnded(creatorinstance.ProcessInstance_Id))
            {
                
                processStore.markProcessInstanceAsEnded(creatorinstance.ProcessInstance_Id, creatorinstance.ProcessSubject_Id, creatorinstance.Owner);
                taskStore.setAllTasksForProcessInstanceAsDone(creatorinstance.ProcessInstance_Id);

                var instances = processStore.getWFInstanceIdsForProcessInstance(creatorinstance.ProcessInstance_Id);
                CoreFunctions c = new CoreFunctions(context.GetValue(cfgWFMBaseAddress), context.GetValue(cfgWFMUsername), context.GetValue(cfgWFMPassword),context.GetValue(cfgSQLConnectionString));
                foreach(var i in instances)
                {
                    try
                    {
                        c.terminateSubjectInstance(i);
                    }
                    catch (Exception e)
                    { }           
                }
            }


        }
 protected override void Execute(CodeActivityContext context)
 {
     CoreFunctions core = new CoreFunctions(context.GetValue(cfgWFMBaseAddress), context.GetValue(cfgWFMUsername), context.GetValue(cfgWFMPassword), context.GetValue(cfgSQLConnectionString));
     
     string id = core.startNewSubjectProcess(context.GetValue(ProcessInstanceId),   context.GetValue(ProcessSubjectId), context.GetValue(Owner));
     context.SetValue(NewProcessId, id);
 }
Example #3
0
 private void initCore()
 {
     core = new CoreFunctions(wfmBaseAddress, wfmUsername, wfmPassword, connectionString);
 }