Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }
Ejemplo n.º 4
0
//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");
        }
Ejemplo n.º 5
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;
         */
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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();
        }
Ejemplo n.º 8
0
        /// <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);
                }
            }
        }
Ejemplo n.º 9
0
 public BusinessProcessModel(BusinessProcess businessProcess)
 {
     _businessProcess = businessProcess;
     _location        = new LocationModel {
         Lat = _businessProcess.Lat, Lng = _businessProcess.Lng, Address = _businessProcess.Address
     };
 }
Ejemplo n.º 10
0
        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();
            }
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
 public void ThenTheBatchCommitsWithoutErrorsOrExceptions()
 {
     if (!BusinessProcess.IsCompleted())
     {
         throw new Exception("Batch committed with exceptions or errors.");
     }
 }
Ejemplo n.º 13
0
        /// <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"));
        }
Ejemplo n.º 15
0
        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();
     }
 }
Ejemplo n.º 18
0
        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();
            }
        }
Ejemplo n.º 19
0
 internal static void Sleep(TimeSpan value, BusinessProcess process, AEvent evnt)
 {
     lock (_suspendedEvents)
     {
         _suspendedEvents.Add(new sProcessSuspendEvent(process, evnt, value));
     }
     _backgroundMREEvent.Set();
 }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
        public static Response ToResponse(this BusinessProcess process)
        {
            Response rp = new Response();

            rp.Infos  = process.GetInfos();
            rp.Errors = process.GetErrors();
            return(rp);
        }
Ejemplo n.º 22
0
//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)));
        }
Ejemplo n.º 23
0
        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;
            }
        }
Ejemplo n.º 24
0
 public ActionResult EditKendo([DataSourceRequest] DataSourceRequest request, BusinessProcess item)
 {
     if (ModelState.IsValid)
     {
         _BusinessProcessService.Update(item);
         return(Json(ModelState.ToDataSourceResult()));
     }
     return(Json(ModelState.ToDataSourceResult()));
 }
Ejemplo n.º 25
0
        public ActionResult Delete(int id = 0)
        {
            BusinessProcess item = _BusinessProcessService.FindById(id);

            if (item == null)
            {
                return(HttpNotFound());
            }
            return(View(item));
        }
Ejemplo n.º 26
0
        public ActionResult Promote(BusinessProcessState st)
        {
            loadLookups();
            BusinessProcess item = _BusinessProcessService.FindById(st.ParentBusinessProcessID);

            item.ProcessTypeID = st.StateID;
            _BusinessProcessService.Update(item);
            _BusinessProcessStateService.Add(st);
            return(View());
        }
Ejemplo n.º 27
0
 public bool Delete(BusinessProcess item)
 {
     if (item == null)
     {
         return(false);
     }
     _unitOfWork.BusinessProcessRepository.Delete(item);
     _unitOfWork.Save();
     return(true);
 }
Ejemplo n.º 28
0
        public async Task <IActionResult> Edit([FromBody] BusinessProcess businessProcess)
        {
            if (businessProcess is null)
            {
                throw new ArgumentNullException(nameof(businessProcess));
            }
            await _businessProcessRepositary.Save(businessProcess);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 29
0
//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());
        }
Ejemplo n.º 30
0
 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));
     }
 }