public ActionResult Create(PaymentRequest request) { if (ModelState.IsValid) { int BP_PR = _ApplicationSettingService.getPaymentRequestWorkflow(); if (BP_PR != 0) { BusinessProcessState createdstate = new BusinessProcessState { DatePerformed = DateTime.Now, PerformedBy = "System", Comment = "Created workflow for Payment Request" }; //_PaymentRequestservice.Create(request); BusinessProcess bp = _BusinessProcessService.CreateBusinessProcess(BP_PR, request.PaymentRequestID, "PaymentRequest", createdstate); request.BusinessProcessID = bp.BusinessProcessID; request.RequestedDate = DateTime.Now; _PaymentRequestservice.Create(request); //_PaymentRequestservice.Update(request); return(RedirectToAction("Index")); } ViewBag.ErrorMessage1 = "The workflow assosiated with Payment Request doesnot exist."; ViewBag.ErrorMessage2 = "Please make sure the workflow is created and configured."; } LoadLookups(); ModelState.AddModelError("Errors", @"Could not create Request Plan."); return(View(request)); }
public override T get <T>(Contextual <T> contextual) { Bean <T> bean = (Bean <T>)contextual; string variableName = bean.Name; BusinessProcess businessProcess = BusinessProcess; object variable = businessProcess.getVariable(variableName); if (variable != null) { if (logger.isLoggable(Level.FINE)) { if (businessProcess.Associated) { logger.fine("Getting instance of bean '" + variableName + "' from Execution[" + businessProcess.ExecutionId + "]."); } else { logger.fine("Getting instance of bean '" + variableName + "' from transient bean store"); } } return((T)variable); } else { return(null); } }
public override void Update(BusinessProcess BP) { BP.AddForUpdate(GetPerson()); BP.AddForUpdate(DB.AKA); BP.AddForUpdate(DB.Address); BP.AddForUpdate(DB.ApptRecurrence); BP.AddForUpdate(DB.Appointment); BP.AddForUpdate(DB.Attendee); BP.AddForUpdate(DB.SRP); BP.AddForUpdate(DB.IRP); BP.AddForUpdate(DB.RiskAssessment); BP.AddForUpdate(DB.RAClientImpact); BP.AddForUpdate(DB.FileOffice); BP.AddForUpdate(DB.FileContact); BP.AddForUpdate(GetFileXRef()); BP.AddForUpdate(DB.secFileRule); BP.AddForUpdate(DB.FileFlag); BP.AddForUpdate(DB.ArchiveBatch); if (myddEntity != null) { foreach (ddEntityBE d in myddEntity.Values) { BP.AddForUpdate(d); } } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test @Deployment public void testParallelMultiInstanceServiceTasks() public virtual void testParallelMultiInstanceServiceTasks() { BusinessProcess businessProcess = getBeanInstance(typeof(BusinessProcess)); businessProcess.setVariable("list", Arrays.asList(new string[] { "1", "2" })); businessProcess.startProcessByKey("miParallelScriptTask"); }
/* * BusinessProcessState createdstate = new BusinessProcessState * { * DatePerformed = DateTime.Now, * PerformedBy = "System", * Comment = "Created workflow for Payment Request" * * }; * _PaymentRequestservice.Create(request); * * BusinessProcess bp = _BusinessProcessService.CreateBusinessProcess(BP_PR,request.PaymentRequestID, * "PaymentRequest", createdstate); * request.BusinessProcessID = bp.BusinessProcessID; */ public BusinessProcess CreateBusinessProcessForObject(int templateID, int DocumentID, string DocumentType, bool save = false) { StateTemplate startingTemplate = _unitOfWork.StateTemplateRepository.FindBy(s => s.ParentProcessTemplateID == templateID && s.StateType == 0).Single(); BusinessProcess bp = new BusinessProcess { ProcessTypeID = templateID, DocumentID = DocumentID, DocumentType = DocumentType }; BusinessProcessState StartingState = new BusinessProcessState { DatePerformed = DateTime.Now, PerformedBy = "System", Comment = "Created workflow for" + DocumentType }; _unitOfWork.BusinessProcessRepository.Add(bp); StartingState.ParentBusinessProcess = bp; StartingState.StateID = startingTemplate.StateTemplateID; _unitOfWork.BusinessProcessStateRepository.Add(StartingState); bp.CurrentStateID = StartingState.BusinessProcessStateID; // _unitOfWork.BusinessProcessRepository.Edit(bp); // PromotWorkflow(StartingState); if (save) { _unitOfWork.Save(); } return(bp); }
public virtual void testGetAndClearCachedVariableMap() { BusinessProcess businessProcess = getBeanInstance(typeof(BusinessProcess)); // initially the variable cache is empty assertEquals(Collections.EMPTY_MAP, businessProcess.AndClearCachedVariableMap); // set a variable businessProcess.setVariable("aVariableName", "aVariableValue"); // now the variable is set assertEquals(Collections.singletonMap("aVariableName", "aVariableValue"), businessProcess.AndClearCachedVariableMap); // now the variable cache is empty assertEquals(Collections.EMPTY_MAP, businessProcess.AndClearCachedVariableMap); businessProcess.startProcessByKey("businessProcessBeanTest"); // now the variable cache is empty again: assertEquals(Collections.EMPTY_MAP, businessProcess.AndClearCachedVariableMap); // set a variable businessProcess.setVariable("anotherVariableName", "aVariableValue"); // now the variable is set assertEquals(Collections.singletonMap("anotherVariableName", "aVariableValue"), businessProcess.AndClearCachedVariableMap); }
private void WriteErrorLog(string errorMsg) { if (errorLog == null) { //create error log doc errorLog = (docDB.DocumentRow)myA.GetDocMng().GetDocument().Add(myA.CurrentFile); myA.GetDocMng().GetDocContent().Add(errorLog); errorLog.IsDraft = true; errorLog.DocContentRow.Ext = ".txt"; errorLog.efSubject = DocumentBE.VerifySubjectLength(Resources.DisbursementImportErrorLog); errorLog.DocContentRow.ContentsAsText = Resources.DisbErrorHeader + Environment.NewLine; } //StreamWriter sr; //if (!File.Exists(filePath)) // sr = File.CreateText(filePath); //else // sr = new StreamWriter(filePath, true); //sr.WriteLine (errorMsg); //sr.Close(); errorLog.DocContentRow.ContentsAsText += errorMsg + Environment.NewLine; BusinessProcess bp = myA.GetDocMng().GetBP(); bp.AddForUpdate(myA.GetDocMng().GetDocContent()); bp.AddForUpdate(myA.GetDocMng().GetDocument()); bp.Update(); }
/// <summary> /// Launches the add attribute form. /// </summary> /// <param name="dimensionName">Name of the dimension.</param> /// <param name="parentName">Name of the parent.</param> private void LaunchAddAttribute(string dimensionName, string parentName) { string businessProcess = this.tabControlArea.SelectedTab.Text; BusinessProcess b = this.cmodel.GetBusinessProcess(businessProcess); using (AddAttribute am = new AddAttribute(b, dimensionName, parentName)) { Point location = new Point((this.Left + (this.Width / 2)) - am.Width / 2, (this.Top + (this.Height / 2)) - am.Height / 2); am.StartPosition = FormStartPosition.Manual; am.Location = location; var result = am.ShowDialog(); if (result == DialogResult.OK) { Level l = new Level(); if (am.IsSharedNode.Checked) { Level sh = b.GetSharedNodeLevelByUID(am.SharedNodeName.SelectedValue.ToString()); if (am.ConvergedKey.Checked) { l.ConvergedKey = sh.Key; } else if (am.CDAKey.Checked) { l.CDAKey = sh.Key; } else { l.Key = sh.Key; } } else { l.Name = am.AttributeName.Text; l.Type = (LevelType)Enum.Parse(typeof(LevelType), am.AttributeType.Text); l.OptionalLevel = am.OptionalLevel.Checked; l.OptionalRelationship = am.OptionalBranch.Checked; l.MultipleRelationship = am.ManyToMany.Checked; l.Recursive = am.Recursive.Checked; } Dimension d = b.GetDimension(am.Dimension.Text); if (am.Parent.Text.ToString() == "n/a" && am.Parent.SelectedValue == null) { d.Level = l; } else { Level parent = d.GetLevelByUID(am.Parent.SelectedValue.ToString()); if (parent.Level1 == null) { parent.Level1 = new List <Level>();; } parent.Level1.Add(l); } this.Draw(); tabControlArea.SelectTab(businessProcess); } } }
public BusinessProcessModel(BusinessProcess businessProcess) { _businessProcess = businessProcess; _location = new LocationModel { Lat = _businessProcess.Lat, Lng = _businessProcess.Lng, Address = _businessProcess.Address }; }
internal void CreateGroup(officeDB.OfficeRow or, FileManager offFM) { SecurityDB.secGroupRow gr = (SecurityDB.secGroupRow)offFM.AtMng.SecurityManager.GetsecGroup().Add(null); gr.GroupName = or.OfficeName; gr.DescE = or.OfficeName; gr.DescF = or.OfficeNameFre; BusinessProcess bp = myA.GetBP(); bp.AddForUpdate(offFM.AtMng.SecurityManager.GetsecGroup()); bp.Update(); offFM.EFile.BreakInherit(); atriumDB.secFileRuleRow sfr = (atriumDB.secFileRuleRow)offFM.GetsecFileRule().Add(offFM.CurrentFile); sfr.FileId = offFM.CurrentFile.FileId; sfr.GroupId = gr.GroupId; sfr.RuleId = (int)atSecurity.SpecialRules.GeneralRule; BusinessProcess bp1 = myA.GetBP(); bp1.AddForUpdate(offFM.GetsecFileRule()); bp1.Update(); //get rid of new row if present as database new row will have been returned with a different pkid lmDatasets.atriumDB.secFileRuleRow sfr0 = offFM.DB.secFileRule.FindById(0); if (sfr0 != null) { offFM.DB.secFileRule.RemovesecFileRuleRow(sfr0); offFM.DB.secFileRule.AcceptChanges(); } }
public WorkFlowFormViewModel Load(WorkFlowFormViewModel workFlowFormViewModel) { var healthInformationFormList = _unitOfWork.Repository <BusinessProcess>().GetList(x => x.OwnerId == workFlowFormViewModel.OwnerId).ToList(); if (healthInformationFormList.Count() == 0) { var physicalExamination = new BusinessProcess() { Name = "Physical Examination", OwnerId = workFlowFormViewModel.OwnerId }; var psychotechniqueResult = new BusinessProcess() { Name = "Psychotechnique Result", OwnerId = workFlowFormViewModel.OwnerId }; _unitOfWork.Repository <BusinessProcess>().Add(physicalExamination); _unitOfWork.Repository <BusinessProcess>().Add(psychotechniqueResult); _unitOfWork.Complete(); healthInformationFormList.Add(physicalExamination); healthInformationFormList.Add(psychotechniqueResult); } SubBusinessProcessViewModel healthInformationForm = new SubBusinessProcessViewModel { SubBusinessProcessList = healthInformationFormList }; Mapper.Map(workFlowFormViewModel, healthInformationForm); return(healthInformationForm); }
public void ThenTheBatchCommitsWithoutErrorsOrExceptions() { if (!BusinessProcess.IsCompleted()) { throw new Exception("Batch committed with exceptions or errors."); } }
/// <summary> /// Initializes a new instance of the <see cref="AddAggregation"/> class. /// </summary> /// <param name="b">The BusinessProcess b.</param> public AddAggregation(BusinessProcess b) { InitializeComponent(); if (b.Dimensions != null && b.Dimensions.Count() > 0) { List <Object> items = new List <Object>(); foreach (Dimension d in b.Dimensions) { if (d.Level != null && d.Level.Level1 != null && d.Level.Level1.Count() != 0) { List <Level> list = d.Level.FlattenChildren(); foreach (Level l in list) { items.Add(new { Text = d.Name + ": " + (l.Name != null?l.Name:(l.Key != null?l.Key:(l.CDAKey != null?l.CDAKey:(l.ConvergedKey != null?l.ConvergedKey:"Unknown")))), Value = l.UID }); } } } this.Level.DisplayMember = "Text"; this.Level.ValueMember = "Value"; this.Level.DataSource = items; } }
public IActionResult DeleteConfirmed(int id) { BusinessProcess businessProcess = _repository.GetOneBusinessProcess(b => b.Id == id); _repository.Remove(businessProcess); return(RedirectToAction("Index")); }
public virtual void testGetAndClearCachedLocalVariableMap() { BusinessProcess businessProcess = getBeanInstance(typeof(BusinessProcess)); // initially the variable cache is empty assertEquals(Collections.EMPTY_MAP, businessProcess.AndClearCachedLocalVariableMap); // set a variable - this should fail before the process is started try { businessProcess.setVariableLocal("aVariableName", "aVariableValue"); fail("exception expected!"); } catch (ProcessEngineCdiException e) { assertEquals("Cannot set a local cached variable: neither a Task nor an Execution is associated.", e.Message); } // the variable cache is still empty assertEquals(Collections.EMPTY_MAP, businessProcess.AndClearCachedLocalVariableMap); businessProcess.startProcessByKey("businessProcessBeanTest"); // now the variable cache is empty again: assertEquals(Collections.EMPTY_MAP, businessProcess.AndClearCachedLocalVariableMap); // set a variable businessProcess.setVariableLocal("anotherVariableName", "aVariableValue"); // now the variable is set assertEquals(Collections.singletonMap("anotherVariableName", "aVariableValue"), businessProcess.AndClearCachedLocalVariableMap); }
public Task BindModelAsync(ModelBindingContext bindingContext) { if (bindingContext is null) { throw new System.ArgumentNullException(nameof(bindingContext)); } var serializedId = bindingContext.ValueProvider.GetValue(nameof(BusinessProcess.Id)).FirstValue; var name = bindingContext.ValueProvider.GetValue(nameof(BusinessProcess.Name)).FirstValue; var serializedDiagram = bindingContext.ValueProvider.GetValue(nameof(BusinessProcess.SerializedDiagram)).FirstValue; if (serializedId == null || name == null || serializedDiagram == null) { throw new System.ApplicationException("Not all fields provided for binding context."); } if (!ObjectId.TryParse(serializedId, out ObjectId id)) { bindingContext.ModelState.TryAddModelError(bindingContext.ModelName, "Business process Id must be an ObjectId."); return(Task.CompletedTask); } if (string.IsNullOrWhiteSpace(name)) { bindingContext.ModelState.TryAddModelError(bindingContext.ModelName, "Name should not be empty."); return(Task.CompletedTask); } var model = new BusinessProcess { Id = id, Name = name, SerializedDiagram = serializedDiagram }; bindingContext.Result = ModelBindingResult.Success(model); return(Task.CompletedTask); }
/// <summary> /// Validates this instance. /// </summary> /// <exception cref="InvalidMessageBody"></exception> /// <exception cref="InvalidMessageHeader"></exception> /// <exception cref="InvalidMainActivityId"></exception> /// <exception cref="InvalidStageActivityId"></exception> /// <exception cref="InvalidBusinessTransactionException"> /// </exception> /// <exception cref="InvalidStageNameException"></exception> public void Validate() { if (MessageBody.IsNullOrEmpty()) { throw new InvalidMessageBody(); } if (MessageHeader.IsNullOrEmpty()) { throw new InvalidMessageHeader(); } if (MainActivityId == default) { throw new InvalidMainActivityId(); } if (StageActivityId == default) { throw new InvalidStageActivityId(); } if (BusinessTransaction.IsNullOrEmpty()) { throw new InvalidBusinessTransactionException(); } if (BusinessProcess.IsNullOrEmpty()) { throw new InvalidBusinessTransactionException(); } if (CurrentStage.IsNullOrEmpty()) { throw new InvalidStageNameException(); } }
public void SaveAll() { BusinessProcess bp = GetBP(); if (!IsVirtualFM && this.CurrentFile != null && this.CurrentFile.RowState == DataRowState.Added) { bp.AddForUpdate(this.EFile); bp.AddForUpdate(this.GetFileXRef()); this.GetActivity().Update(bp); } else { this.GetActivity().Update(bp); //efile must be update again at the end to save the filestructxml changes bp.AddForUpdate(this.EFile); } foreach (BEManager be in this.MyMngrs.Values) { be.Update(bp); } bp.Update(); if (!IsVirtualFM && this.CurrentFile != null) { this.CurrentFile.FileStructXml = EFile.CalcFileStructXml(this.CurrentFile, true, false).OuterXml; this.CurrentFile.AcceptChanges(); } }
internal static void Sleep(TimeSpan value, BusinessProcess process, AEvent evnt) { lock (_suspendedEvents) { _suspendedEvents.Add(new sProcessSuspendEvent(process, evnt, value)); } _backgroundMREEvent.Set(); }
public static Response <T> ToResponse <T>(this BusinessProcess process, T data) { Response <T> rp = new Response <T>(data); rp.Infos = process.GetInfos(); rp.Errors = process.GetErrors(); return(rp); }
public static Response ToResponse(this BusinessProcess process) { Response rp = new Response(); rp.Infos = process.GetInfos(); rp.Errors = process.GetErrors(); return(rp); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test @Deployment public void testResolution() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: public virtual void testResolution() { BusinessProcess businessProcess = getBeanInstance(typeof(BusinessProcess)); businessProcess.startProcessByKey("testResolution").Id; assertNotNull(getBeanInstance(typeof(CreditCard))); }
private void selectProcess(long selectedIndex, string description) { if (MainProcess.User <= 0) { "Необхідно авторизуватися (відсканувати себе)!".Warning(); return; } BusinessProcess process = null; Processes SelectedProcess = (Processes)selectedIndex; switch (SelectedProcess) { case Processes.Acceptance: MainProcess.ClearControls(); process = new Acceptance(); break; case Processes.Movement: MainProcess.ClearControls(); process = new Movement(); break; case Processes.Selection: process = tryStartPicking(); break; case Processes.Inventory: MainProcess.ClearControls(); process = new Inventory(); break; case Processes.StickerRepeating: MainProcess.ClearControls(); process = new StickerRepeating(); break; case Processes.ReturnFromHaul: MainProcess.ClearControls(); process = new ReturnFromHaul(); break; case Processes.BarcodeChecking: MainProcess.ClearControls(); process = new BarcodeChecking(); break; case Processes.IsPalletFull: MainProcess.ClearControls(); process = new IsPalletFull(); break; } if (process != null) { MainProcess.Process = process; } }
public ActionResult EditKendo([DataSourceRequest] DataSourceRequest request, BusinessProcess item) { if (ModelState.IsValid) { _BusinessProcessService.Update(item); return(Json(ModelState.ToDataSourceResult())); } return(Json(ModelState.ToDataSourceResult())); }
public ActionResult Delete(int id = 0) { BusinessProcess item = _BusinessProcessService.FindById(id); if (item == null) { return(HttpNotFound()); } return(View(item)); }
public ActionResult Promote(BusinessProcessState st) { loadLookups(); BusinessProcess item = _BusinessProcessService.FindById(st.ParentBusinessProcessID); item.ProcessTypeID = st.StateID; _BusinessProcessService.Update(item); _BusinessProcessStateService.Add(st); return(View()); }
public bool Delete(BusinessProcess item) { if (item == null) { return(false); } _unitOfWork.BusinessProcessRepository.Delete(item); _unitOfWork.Save(); return(true); }
public async Task <IActionResult> Edit([FromBody] BusinessProcess businessProcess) { if (businessProcess is null) { throw new ArgumentNullException(nameof(businessProcess)); } await _businessProcessRepositary.Save(businessProcess); return(RedirectToAction("Index")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test @Deployment public void testProcessWithoutWatestate() public virtual void testProcessWithoutWatestate() { BusinessProcess businessProcess = getBeanInstance(typeof(BusinessProcess)); // start the process businessProcess.startProcessByKey("businessProcessBeanTest").Id; // assert that the process is ended: assertNull(processEngine.RuntimeService.createProcessInstanceQuery().singleResult()); }
public void ThenTheBatchCommitsWithoutErrorsOrExceptionsAndRecordProcessed(int numRecords) { if (!BusinessProcess.IsCompleted()) { throw new Exception("Batch committed with exceptions or errors."); } if (!BusinessProcess.IsNumRecordsProcessed(numRecords)) { throw new Exception(String.Format("'{0}' was not the number of records processed.", numRecords)); } }