Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCreateBothAsyncJobDefinitionWithParseListener()
        public virtual void testCreateBothAsyncJobDefinitionWithParseListener()
        {
            //given
            string            modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);

            //when the asyncBefore and asyncAfter is set to true in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);

            //then there exists two job definitions
            JobDefinitionQuery    query       = engineRule.ManagementService.createJobDefinitionQuery();
            IList <JobDefinition> definitions = query.orderByJobConfiguration().asc().list();

            assertEquals(definitions.Count, 2);

            //asyncAfter
            JobDefinition asyncAfterAfter = definitions[0];

            assertEquals(asyncAfterAfter.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(asyncAfterAfter.ActivityId, "servicetask1");
            assertEquals(asyncAfterAfter.JobConfiguration, MessageJobDeclaration.ASYNC_AFTER);

            //asyncBefore
            JobDefinition asyncAfterBefore = definitions[1];

            assertEquals(asyncAfterBefore.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(asyncAfterBefore.ActivityId, "servicetask1");
            assertEquals(asyncAfterBefore.JobConfiguration, MessageJobDeclaration.ASYNC_BEFORE);
        }
Exemplo n.º 2
0
        protected internal virtual void deployConditionalEventSubProcess(BpmnModelInstance model, string parentId, string conditionExpr, bool isInterrupting)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.model.bpmn.BpmnModelInstance modelInstance = addConditionalEventSubProcess(model, parentId, conditionExpr, TASK_AFTER_CONDITION_ID, isInterrupting);
            BpmnModelInstance modelInstance = addConditionalEventSubProcess(model, parentId, conditionExpr, TASK_AFTER_CONDITION_ID, isInterrupting);

            engine.manageDeployment(repositoryService.createDeployment().addModelInstance(CONDITIONAL_MODEL, modelInstance).deploy());
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeleteNonExistingJobDefinitionWithParseListener()
        public virtual void testDeleteNonExistingJobDefinitionWithParseListener()
        {
            //given
            string            modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);
            //when the asyncBefore is set to false in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);
            //then there exists no job definition
            JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery();

            assertNull(query.singleResult());
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testProcessWithIntermediateConditionalEvent()
        public virtual void testProcessWithIntermediateConditionalEvent()
        {
            //given
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(CONDITIONAL_EVENT_PROCESS_KEY).startEvent().serviceTask().camundaClass(typeof(CheckDelayedVariablesDelegate).FullName).intermediateCatchEvent().conditionalEventDefinition().condition("${var==1}").conditionalEventDefinitionDone().endEvent().done();

            //when process is deployed and instance created
            rule.manageDeployment(rule.RepositoryService.createDeployment().addModelInstance(CONDITIONAL_MODEL, modelInstance).deploy());
            ProcessInstanceWithVariablesImpl processInstance = (ProcessInstanceWithVariablesImpl)rule.RuntimeService.startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);

            //then process definition contains property which indicates that conditional events exists
            object property = processInstance.ExecutionEntity.ProcessDefinition.getProperty(BpmnParse.PROPERTYNAME_HAS_CONDITIONAL_EVENTS);

            assertNotNull(property);
            assertEquals(true, property);
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCreateJobDefinitionWithParseListener()
        public virtual void testCreateJobDefinitionWithParseListener()
        {
            //given
            string            modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);

            //when the asyncBefore is set in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);

            //then there exists a new job definition
            JobDefinitionQuery query  = engineRule.ManagementService.createJobDefinitionQuery();
            JobDefinition      jobDef = query.singleResult();

            assertNotNull(jobDef);
            assertEquals(jobDef.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(jobDef.ActivityId, "servicetask1");
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void deployTestProcesses() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void deployTestProcesses()
        {
            org.camunda.bpm.engine.repository.Deployment deployment = engineRule.RepositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/externaltask/oneExternalTaskProcess.bpmn20.xml").addClasspathResource("org/camunda/bpm/engine/test/api/externaltask/externalTaskPriorityExpression.bpmn20.xml").deploy();

            engineRule.manageDeployment(deployment);

            RuntimeService runtimeService = engineRule.RuntimeService;

            processInstanceIds = new List <string>();
            for (int i = 0; i < 4; i++)
            {
                processInstanceIds.Add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY, i + "").Id);
            }
            processInstanceIds.Add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY_2).Id);
        }
Exemplo n.º 7
0
 protected internal virtual void deployAndStartProcess(BpmnModelInstance modelInstance, BpmnModelInstance testProcess)
 {
     engineRule.manageDeployment(engineRule.RepositoryService.createDeployment().addModelInstance("process.bpmn", modelInstance).deploy());
     engineRule.manageDeployment(engineRule.RepositoryService.createDeployment().addModelInstance("testProcess.bpmn", testProcess).deploy());
     engineRule.RuntimeService.startProcessInstanceByKey(PROCESS_ID);
 }