private void startSuggestionProcess(DataModels.Announcement.Suggestion dataModel, IDAL dal) { int processDefinitionId = _parameterReader.ReadPublicParameter <int>("OneriSureci", 2011); var processInstanceRef = dataModel.SuggestionId.ToString(); GroupOperations gop = new GroupOperations(dal); Group suggestionAdminGroup = gop.FindGroup("Öneri Değerlendirme Kullanıcıları"); IProcessInstance processInstance = new ProcessInstance(processDefinitionId, OTApplication.Context.User.Id); //Set Process Variables processInstance.AddProcessVariable("user", OTApplication.Context.User.Id); processInstance.AddProcessVariable("screenReference", "Announcement#SuggestionListComponent#" + processInstanceRef); processInstance.AddProcessVariable("suggestionAdminGroup", suggestionAdminGroup.GroupId); processInstance.AddProcessVariable("suggestionId", dataModel.SuggestionId); //Set Action Varibles processInstance.AddActionVariable("user", OTApplication.Context.User.Id); //processInstance.AddActionVariable("description", dataModel.Description); //Start Process var processId = processInstance.Start(processInstanceRef); dataModel.ProcessInstance = processId; dal.Update(dataModel); }
public void TakeAction(DataModels.Announcement.Suggestion dataObject, long actionId, string choice, string comment) { using (IDAL dal = this.DAL) { dal.BeginTransaction(); try { // var originalObject = dal.Read<DataModels.Announcement.Suggestion>(dataObject.SuggestionId); IActionOperations actionOperations = new Overtech.API.BPM.ActionOperations(OTApplication.Context.User.Id); var actionInfo = actionOperations.GetActionInfo(actionId); IAction action = new Overtech.API.BPM.Action(actionId, OTApplication.Context.User.Id); dal.Update(dataObject); action.Commit(choice, comment); dal.CommitTransaction(); } catch { dal.RollbackTransaction(); throw; } } }