public void addNewProcess(P_Process p) { db.P_Processes.Add(p); db.SaveChanges(); }
private void submitTaskAnswer(DynamicValue val, P_Process process, T_Task openTask) { //create and publish notification WorkflowManagementClient client = new WorkflowManagementClient(new Uri(baseAddress + process.WFM_RootScope + process.WFM_ProcessScope), credentials); client.PublishNotification(new WorkflowNotification() { Properties = { { "NotificationType", "taskAnswer" }, { "wfID", openTask.WFId }, { "OrderId", openTask.InternalOrderId } }, Content = new Dictionary<string, object>() { { "data", val } } }); }
public string addProcess(string companyScopeName, string processScopeName, string workflow_MessageTier_Path, List<SubjectConfig> processSubjects, bool createDBEntries, string startSubjectname, int WS_Project_Id, int WS_Project_Version, string processInfo) { string scope = createProcessScope(companyScopeName, processScopeName); WorkflowManagementClient client = new WorkflowManagementClient(new Uri(cfgWFMBaseAddress + companyScopeName + "/" + processScopeName + "/"), credentials); client.PublishWorkflow(workflow_MessageTier_Name, workflow_MessageTier_Path, new MatchAllSubscriptionFilter() //Filter { Matches = { { "NotificationType" , "NewMessage" } } }); foreach (SubjectConfig process in processSubjects) { if (process.Xaml != null) { client.PublishWorkflowString(process.Name, process.Xaml); } } if (createDBEntries) { IProcessStore processStore = StoreHandler.getProcessStore(cfgSQLConnectionString); P_Process newProcess = new P_Process(processScopeName); newProcess.WS_ProjectId = WS_Project_Id; newProcess.WS_Project_Version = WS_Project_Version; newProcess.WFM_ProcessScope = processScopeName; newProcess.ProcessInfo = processInfo; newProcess.WFM_RootScope = companyScopeName + "/"; newProcess.ProcessSubjects = new List<P_ProcessSubject>(); foreach (SubjectConfig process in processSubjects) { if (process.Xaml != null) newProcess.ProcessSubjects.Add(new P_ProcessSubject(process.Name, process.Name.Equals(startSubjectname), process.Name, process.Role_Id, process.MultiSubject)); else newProcess.ProcessSubjects.Add(new P_ProcessSubject(process.Name, process.Name.Equals(startSubjectname), null, process.Role_Id, process.MultiSubject)); } processStore.addNewProcess(newProcess); } return scope; }