示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCallBpmnProcessReconfigureCallActivity()
        public virtual void testCallBpmnProcessReconfigureCallActivity()
        {
            // given
            BpmnModelInstance model = CallActivityModels.oneBpmnCallActivityProcess("oneTaskProcess");

            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(model);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(modify(model).callActivityBuilder("callActivity").calledElement("foo").done());

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapActivities("callActivity", "callActivity").build();

            // when
            ProcessInstance processInstance = testHelper.createProcessInstanceAndMigrate(migrationPlan);

            // then the called instance has not changed (e.g. not been migrated to a different process definition)
            ProcessInstance calledInstance = rule.RuntimeService.createProcessInstanceQuery().processDefinitionKey("oneTaskProcess").singleResult();

            Assert.assertNotNull(calledInstance);

            // and it is possible to complete the called process instance
            testHelper.completeTask("userTask");
            // and the calling process instance
            testHelper.completeTask("userTask");

            testHelper.assertProcessEnded(processInstance.Id);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeletesOnlyVariablesFromRemovingScope()
        public virtual void testDeletesOnlyVariablesFromRemovingScope()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.DOUBLE_SUBPROCESS_MODEL);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.COMPENSATION_ONE_TASK_SUBPROCESS_MODEL);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapActivities("innerSubProcess", "subProcess").mapActivities("userTask2", "userTask2").mapActivities("compensationBoundary", "compensationBoundary").build();

            ProcessInstance processInstance = rule.RuntimeService.startProcessInstanceById(sourceProcessDefinition.Id);

            Execution innerSubProcessExecution = rule.RuntimeService.createExecutionQuery().activityId("userTask1").singleResult();

            string outerSubProcessExecutionId = ((ExecutionEntity)innerSubProcessExecution).ParentId;

            rule.RuntimeService.setVariableLocal(outerSubProcessExecutionId, "outerVariable", "outerValue");
            rule.RuntimeService.setVariableLocal(innerSubProcessExecution.Id, "innerVariable", "innerValue");

            testHelper.completeTask("userTask1");

            // when
            testHelper.migrateProcessInstance(migrationPlan, processInstance);

            // then
            Assert.assertEquals(1, testHelper.snapshotAfterMigration.getVariables().Count);

            VariableInstance migratedVariable = testHelper.snapshotAfterMigration.getSingleVariable("innerVariable");

            Assert.assertNotNull(migratedVariable);
            Assert.assertEquals("innerValue", migratedVariable.Value);
        }
示例#3
0
        public virtual void testInitCompletion()
        {
            // when compensation is thrown
            Task beforeCompensationTask = rule.taskQuery().singleResult();

            rule.TaskService.complete(beforeCompensationTask.Id);

            // then there is an active compensation handler task
            Task compensationHandlerTask = rule.taskQuery().singleResult();

            Assert.assertNotNull(compensationHandlerTask);
            Assert.assertEquals("undoTask", compensationHandlerTask.TaskDefinitionKey);

            // and it can be completed such that the process instance ends successfully
            rule.TaskService.complete(compensationHandlerTask.Id);

            Task afterCompensateTask = rule.taskQuery().singleResult();

            Assert.assertNotNull(afterCompensateTask);
            Assert.assertEquals("afterCompensate", afterCompensateTask.TaskDefinitionKey);

            rule.TaskService.complete(afterCompensateTask.Id);

            rule.assertScenarioEnded();
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeployProcessWithoutIsExecutableAttribute()
        public virtual void testDeployProcessWithoutIsExecutableAttribute()
        {
            RuntimeService  runtimeService = engineRule.RuntimeService;
            ProcessInstance procInstance   = runtimeService.startProcessInstanceByKey("processWithoutIsExecutableAttribute");

            Assert.assertNotNull(procInstance);
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testFallbackSerializerDoesNotOverrideRegularSerializer()
        public virtual void testFallbackSerializerDoesNotOverrideRegularSerializer()
        {
            // given
            // that the process engine is configured with a serializer for a certain format
            // and a fallback serializer factory for the same format
            ProcessEngineConfigurationImpl engineConfiguration = (new StandaloneInMemProcessEngineConfiguration()).setJdbcUrl("jdbc:h2:mem:camunda-forceclose").setProcessEngineName("engine-forceclose");

            engineConfiguration.CustomPreVariableSerializers = Arrays.asList <TypedValueSerializer>(new ExampleConstantSerializer());
            engineConfiguration.FallbackSerializerFactory    = new ExampleSerializerFactory();

            processEngine = engineConfiguration.buildProcessEngine();
            deployOneTaskProcess(processEngine);

            // when setting a variable that no regular serializer can handle
            ObjectValue objectValue = Variables.objectValue("foo").serializationDataFormat(ExampleSerializer.FORMAT).create();

            ProcessInstance pi = processEngine.RuntimeService.startProcessInstanceByKey("oneTaskProcess", Variables.createVariables().putValueTyped("var", objectValue));

            ObjectValue fetchedValue = processEngine.RuntimeService.getVariableTyped(pi.Id, "var", true);

            // then the fallback serializer is used
            Assert.assertNotNull(fetchedValue);
            Assert.assertEquals(ExampleSerializer.FORMAT, fetchedValue.SerializationDataFormat);
            Assert.assertEquals(ExampleConstantSerializer.DESERIALIZED_VALUE, fetchedValue.Value);
        }
示例#6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment("clientDeployment") public void testRedeployClassloading()
        public virtual void testRedeployClassloading()
        {
            // given
            org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeploymentQuery().singleResult();

            org.camunda.bpm.engine.repository.Deployment deployment2 = repositoryService.createDeployment().nameFromDeployment(deployment.Id).addDeploymentResources(deployment.Id).deploy();

            // when (2)
            string caseInstanceId = caseService.withCaseDefinitionByKey("case").create().Id;

            string humanTaskId = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").singleResult().Id;

            // then (1)
            VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("listener").caseInstanceIdIn(caseInstanceId);

            Assert.assertNotNull(query.singleResult());
            Assert.assertEquals("listener-notified", query.singleResult().Value);

            caseService.withCaseExecution(caseInstanceId).removeVariable("listener").execute();

            Assert.assertEquals(0, query.count());

            // when (2)
            caseService.withCaseExecution(humanTaskId).complete();

            // then (2)
            Assert.assertNotNull(query.singleResult());
            Assert.assertEquals("listener-notified", query.singleResult().Value);

            repositoryService.deleteDeployment(deployment2.Id, true, true);
        }
示例#7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testResourceName()
        public virtual void testResourceName()
        {
            ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(typeof(ProcessEngine));

            Assert.assertNotNull(processEngine);

            RepositoryService repositoryService = processEngine.RepositoryService;

            ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();

            ProcessDefinition definition = query.processDefinitionKey("process-0").singleResult();

            Assert.assertEquals("process0.bpmn", definition.ResourceName);

            definition = query.processDefinitionKey("process-1").singleResult();
            Assert.assertEquals("processes/process1.bpmn", definition.ResourceName);

            definition = query.processDefinitionKey("process-2").singleResult();
            Assert.assertEquals("process2.bpmn", definition.ResourceName);

            definition = query.processDefinitionKey("process-3").singleResult();
            Assert.assertEquals("subDirectory/process3.bpmn", definition.ResourceName);

            definition = query.processDefinitionKey("process-4").singleResult();
            Assert.assertEquals("process4.bpmn", definition.ResourceName);

            definition = query.processDefinitionKey("process-5").singleResult();
            Assert.assertEquals("subDirectory/process5.bpmn", definition.ResourceName);
        }
示例#8
0
        public virtual void testHistory()
        {
            // given
            Task compensationHandler = rule.taskQuery().singleResult();

            // when
            rule.TaskService.complete(compensationHandler.Id);

            // then history is written for the remaining activity instances
            HistoricProcessInstance historicProcessInstance = rule.historicProcessInstance();

            Assert.assertNotNull(historicProcessInstance);
            Assert.assertNotNull(historicProcessInstance.EndTime);

            HistoricActivityInstance subProcessInstance = rule.HistoryService.createHistoricActivityInstanceQuery().processInstanceId(historicProcessInstance.Id).activityId("subProcess").singleResult();

            Assert.assertNotNull(subProcessInstance);
            Assert.assertNotNull(subProcessInstance.EndTime);
            Assert.assertEquals(historicProcessInstance.Id, subProcessInstance.ParentActivityInstanceId);

            HistoricActivityInstance compensationThrowInstance = rule.HistoryService.createHistoricActivityInstanceQuery().processInstanceId(historicProcessInstance.Id).activityId("throwCompensate").singleResult();

            Assert.assertNotNull(compensationThrowInstance);
            Assert.assertNotNull(compensationThrowInstance.EndTime);
            Assert.assertEquals(subProcessInstance.Id, compensationThrowInstance.ParentActivityInstanceId);

            HistoricActivityInstance compensationHandlerInstance = rule.HistoryService.createHistoricActivityInstanceQuery().processInstanceId(historicProcessInstance.Id).activityId("undoTask").singleResult();

            Assert.assertNotNull(compensationHandlerInstance);
            Assert.assertNotNull(compensationHandlerInstance.EndTime);
            Assert.assertEquals(subProcessInstance.Id, compensationHandlerInstance.ParentActivityInstanceId);
        }
示例#9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            Assert.assertNotNull(ProgrammaticBeanLookup.lookup(typeof(ProcessEngine)));

            // no deployment has been constructed
            Assert.assertEquals(0, repositoryService.createDeploymentQuery().deploymentName("pa").count());
        }
示例#10
0
        public virtual void testInitThrowError()
        {
            // given
            ProcessInstance instance            = rule.processInstance();
            Task            eventSubProcessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();

            // when
            rule.TaskService.complete(eventSubProcessTask.Id);

            // and
            rule.RuntimeService.setVariable(instance.Id, ThrowBpmnErrorDelegate.ERROR_INDICATOR_VARIABLE, true);
            Task innerSubProcessTask = rule.taskQuery().taskDefinitionKey("innerSubProcessTask").singleResult();

            Assert.assertNotNull(innerSubProcessTask);
            rule.TaskService.complete(innerSubProcessTask.Id);

            // then
            Task afterErrorTask = rule.taskQuery().singleResult();

            Assert.assertNotNull(afterErrorTask);
            Assert.assertEquals("escalatedTask", afterErrorTask.TaskDefinitionKey);

            // and
            rule.TaskService.complete(afterErrorTask.Id);
            rule.assertScenarioEnded();
        }
示例#11
0
        public virtual void testInitThrowUnhandledException()
        {
            // given
            ProcessInstance instance            = rule.processInstance();
            Task            eventSubProcessTask = rule.taskQuery().taskDefinitionKey("eventSubProcessTask").singleResult();

            // when
            rule.TaskService.complete(eventSubProcessTask.Id);

            // and
            rule.RuntimeService.setVariable(instance.Id, ThrowBpmnErrorDelegate.EXCEPTION_INDICATOR_VARIABLE, true);
            rule.RuntimeService.setVariable(instance.Id, ThrowBpmnErrorDelegate.EXCEPTION_MESSAGE_VARIABLE, "unhandledException");
            Task innerSubProcessTask = rule.taskQuery().taskDefinitionKey("innerSubProcessTask").singleResult();

            Assert.assertNotNull(innerSubProcessTask);

            // then
            try
            {
                rule.TaskService.complete(innerSubProcessTask.Id);
                Assert.fail("should throw a ThrowBpmnErrorDelegateException");
            }
            catch (ThrowBpmnErrorDelegate.ThrowBpmnErrorDelegateException e)
            {
                Assert.assertEquals("unhandledException", e.Message);
            }
        }
示例#12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMigrateHistoricIncidentAddScope()
        public virtual void testMigrateHistoricIncidentAddScope()
        {
            // given
            ProcessDefinition sourceProcess = testHelper.deployAndGetDefinition(AsyncProcessModels.ASYNC_BEFORE_USER_TASK_PROCESS);
            ProcessDefinition targetProcess = testHelper.deployAndGetDefinition(AsyncProcessModels.ASYNC_BEFORE_SUBPROCESS_USER_TASK_PROCESS);

            MigrationPlan migrationPlan = runtimeService.createMigrationPlan(sourceProcess.Id, targetProcess.Id).mapActivities("userTask", "userTask").build();

            ProcessInstance processInstance = runtimeService.startProcessInstanceById(sourceProcess.Id);

            Job job = managementService.createJobQuery().singleResult();

            managementService.setJobRetries(job.Id, 0);

            // when
            runtimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).execute();

            // then
            ActivityInstance activityInstance = runtimeService.getActivityInstance(processInstance.Id);

            HistoricIncident historicIncident = historyService.createHistoricIncidentQuery().singleResult();

            Assert.assertNotNull(historicIncident);
            Assert.assertEquals(activityInstance.getTransitionInstances("userTask")[0].ExecutionId, historicIncident.ExecutionId);
        }
示例#13
0
        public virtual void testMigrateWithSubTask()
        {
            //given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);

            MigrationPlan migrationPlan = runtimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapEqualActivities().build();

            ProcessInstance processInstance = runtimeService.startProcessInstanceById(sourceProcessDefinition.Id);

            Task task    = taskService.createTaskQuery().singleResult();
            Task subTask = taskService.newTask();

            subTask.ParentTaskId = task.Id;
            taskService.saveTask(subTask);

            // when
            runtimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).execute();

            // then the historic sub task instance is still the same
            HistoricTaskInstance historicSubTaskAfterMigration = historyService.createHistoricTaskInstanceQuery().taskId(subTask.Id).singleResult();

            Assert.assertNotNull(historicSubTaskAfterMigration);
            Assert.assertNull(historicSubTaskAfterMigration.ProcessDefinitionId);
            Assert.assertNull(historicSubTaskAfterMigration.ProcessDefinitionKey);
            Assert.assertNull(historicSubTaskAfterMigration.ExecutionId);
            Assert.assertNull(historicSubTaskAfterMigration.ActivityInstanceId);
        }
示例#14
0
	  public virtual void testInitConcurrentCompletion()
	  {
		// when compensation is thrown
		Task beforeCompensationTask = rule.taskQuery().singleResult();
		rule.TaskService.complete(beforeCompensationTask.Id);

		// then there are two active compensation handler task
		Assert.assertEquals(2, rule.taskQuery().count());
		Task undoTask1 = rule.taskQuery().taskDefinitionKey("undoTask1").singleResult();
		Assert.assertNotNull(undoTask1);

		Task undoTask2 = rule.taskQuery().taskDefinitionKey("undoTask2").singleResult();
		Assert.assertNotNull(undoTask2);

		// and they can be completed such that the process instance ends successfully
		rule.TaskService.complete(undoTask1.Id);
		rule.TaskService.complete(undoTask2.Id);

		Task afterCompensateTask = rule.taskQuery().singleResult();
		Assert.assertNotNull(afterCompensateTask);
		Assert.assertEquals("afterCompensate", afterCompensateTask.TaskDefinitionKey);

		rule.TaskService.complete(afterCompensateTask.Id);

		rule.assertScenarioEnded();
	  }
示例#15
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            JavaSerializable dataObject = (JavaSerializable)execution.getVariable("varName");

            Assert.assertNotNull(dataObject);
            Assert.assertEquals("foo", dataObject.Property);
        }
示例#16
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testExecuteExclusiveFollowUpJobInDifferentProcessInstance()
        public virtual void testExecuteExclusiveFollowUpJobInDifferentProcessInstance()
        {
            testHelper.deploy(CALL_ACTIVITY_PROCESS, ONE_TASK_PROCESS);

            // given
            // a process instance with a single job
            ProcessInstance processInstance = engineRule.RuntimeService.startProcessInstanceByKey("callActivityProcess");

            jobExecutor.start();

            // and first job acquisition that acquires the job
            acquisitionThread.waitForSync();
            acquisitionThread.makeContinueAndWaitForSync();
            // and job is executed
            acquisitionThread.makeContinueAndWaitForSync();

            // then
            // the called instance has been created
            ProcessInstance calledInstance = engineRule.RuntimeService.createProcessInstanceQuery().superProcessInstanceId(processInstance.Id).singleResult();

            Assert.assertNotNull(calledInstance);

            // and there is a transition instance for the service task
            ActivityInstance activityInstance = engineRule.RuntimeService.getActivityInstance(calledInstance.Id);

            Assert.assertEquals(1, activityInstance.getTransitionInstances("serviceTask").Length);

            // but the corresponding job is not locked
            JobEntity followUpJob = (JobEntity)engineRule.ManagementService.createJobQuery().singleResult();

            Assert.assertNotNull(followUpJob);
            Assert.assertNull(followUpJob.LockOwner);
            Assert.assertNull(followUpJob.LockExpirationTime);
        }
示例#17
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDefaultArtifactService() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testDefaultArtifactService()
        {
            ArtifactFactory artifactFactory = new DefaultArtifactFactory();

            DummyArtifact artifact = artifactFactory.getArtifact(typeof(DummyArtifact));

            Assert.assertNotNull(artifact);
        }
示例#18
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment("pa") public void testNullElResolverIsIgnored()
        public virtual void testNullElResolverIsIgnored()
        {
            // The expression should be resolved correctly although the NullElResolver
            // is present
            runtimeService.startProcessInstanceByKey("elServiceTaskProcess");

            Assert.assertNotNull(taskService.createTaskQuery().singleResult());
        }
示例#19
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void constructorTest()
        public virtual void constructorTest()
        {
            Model model = new Model();

            Assert.assertNotNull(model.frameBufferModel);
            Assert.assertNotNull(model.mapViewDimension);
            Assert.assertNotNull(model.mapViewPosition);
        }
示例#20
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnBpmnModelInstance()
        public virtual void shouldReturnBpmnModelInstance()
        {
            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey(TEST_PROCESS).singleResult();

            BpmnModelInstance bpmnModelInstance = repositoryService.getBpmnModelInstance(processDefinition.Id);

            Assert.assertNotNull(bpmnModelInstance);
        }
示例#21
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment(value=PA2) public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            Assert.assertNotNull(processEngine);
            RepositoryService repositoryService = processEngine.RepositoryService;
            long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();

            Assert.assertEquals(1, count);
        }
示例#22
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            this.statefulObject.increment();

            Assert.assertNotNull("the 'scopedCustomer' reference can't be null", this.statefulObject);
            Assert.assertNotNull("the 'scopedCustomer.name' property should be non-null, since it was set in a previous delegate bound to this very thread", this.statefulObject.Name);
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            log.info("the 'uuid' value retrieved from the ScopedCustomer#name property is '" + this.statefulObject.Name + "' in " + this.GetType().FullName);
        }
示例#23
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testExecutionListener()
        public virtual void testExecutionListener()
        {
            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess");

            int?listenerInvocationCount = (int?)runtimeService.getVariable(processInstance.Id, ExecutionListenerProcessApplication.LISTENER_INVOCATION_COUNT);

            Assert.assertNotNull(listenerInvocationCount);
            Assert.assertEquals(5, listenerInvocationCount.Value);
        }
示例#24
0
        public virtual void testSuspensionState()
        {
            // given
            Job job = rule.ManagementService.createJobQuery().jobId(rule.BuisnessKey).singleResult();

            // then
            Assert.assertNotNull(job);
            Assert.assertFalse(job.Suspended);
        }
示例#25
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnBpmnModelInstance()
        public virtual void shouldReturnBpmnModelInstance()
        {
            runtimeService.startProcessInstanceByKey(TEST_PROCESS);

            BpmnElementRetrievalDelegate @delegate = ProgrammaticBeanLookup.lookup(typeof(BpmnElementRetrievalDelegate));

            Assert.assertNotNull(@delegate.BpmnModelElementInstance);
            Assert.assertNotNull(@delegate.BpmnModelInstance);
            Assert.assertEquals(TEST_PROCESS, @delegate.BpmnModelInstance.Definitions.RootElements.GetEnumerator().next().Id);
        }
示例#26
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            Assert.assertNotNull(processEngine);
            RepositoryService repositoryService = processEngine.RepositoryService;

            org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeploymentQuery().singleResult();

            Assert.assertNotNull(deployment);
            Assert.assertEquals(org.camunda.bpm.engine.repository.ProcessApplicationDeployment_Fields.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deployment.Source);
        }
示例#27
0
	  public virtual void testInitConcurrentTriggerCompensationActivityInstanceTree()
	  {
		// given active compensation
		ProcessInstance instance = rule.processInstance();

		// then the activity instance tree is meaningful
		ActivityInstance activityInstance = rule.RuntimeService.getActivityInstance(instance.Id);
		Assert.assertNotNull(activityInstance);
		assertThat(activityInstance).hasStructure(describeActivityInstanceTree(instance.ProcessDefinitionId).beginScope("throwCompensate").activity("undoTask1").activity("undoTask2").done());
	  }
示例#28
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(typeof(ProcessEngine));

            Assert.assertNotNull(processEngine);
            RepositoryService repositoryService = processEngine.RepositoryService;
            long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();

            Assert.assertEquals(1, count);
        }
示例#29
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStartFormDataWithDefaultValueExpression()
        public virtual void testStartFormDataWithDefaultValueExpression()
        {
            string processDefinitionId = repositoryService.createProcessDefinitionQuery().singleResult().Id;

            StartFormData formData     = formService.getStartFormData(processDefinitionId);
            object        defaultValue = formData.FormFields[0].Value.Value;

            Assert.assertNotNull(defaultValue);
            Assert.assertEquals("testString123", defaultValue);
        }
示例#30
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testTaskFormDataWithDefaultValueExpression()
        public virtual void testTaskFormDataWithDefaultValueExpression()
        {
            ProcessInstance instance = runtimeService.startProcessInstanceByKey("elTaskFormProcess");
            Task            task     = taskService.createTaskQuery().processInstanceId(instance.Id).singleResult();

            TaskFormData formData     = formService.getTaskFormData(task.Id);
            object       defaultValue = formData.FormFields[0].Value.Value;

            Assert.assertNotNull(defaultValue);
            Assert.assertEquals("testString123", defaultValue);
        }