Search in sources :

Example 6 with ProcessInstanceWithVariablesImpl

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl in project camunda-bpm-platform by camunda.

the class OnlyDispatchVariableEventOnExistingConditionsTest method testProcessWithoutConditionalEvent.

@Test
public void testProcessWithoutConditionalEvent() {
    // given
    BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(CONDITIONAL_EVENT_PROCESS_KEY).startEvent().serviceTask().camundaClass(CheckNoDelayedVariablesDelegate.class.getName()).userTask().endEvent().done();
    // when process is deployed and instance created
    rule.manageDeployment(rule.getRepositoryService().createDeployment().addModelInstance(CONDITIONAL_MODEL, modelInstance).deploy());
    ProcessInstanceWithVariablesImpl processInstance = (ProcessInstanceWithVariablesImpl) rule.getRuntimeService().startProcessInstanceByKey(CONDITIONAL_EVENT_PROCESS_KEY);
    // then process definition contains no property which indicates that conditional events exists
    Object property = processInstance.getExecutionEntity().getProcessDefinition().getProperty(BpmnParse.PROPERTYNAME_HAS_CONDITIONAL_EVENTS);
    assertNull(property);
}
Also used : ProcessInstanceWithVariablesImpl(org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance) Test(org.junit.Test)

Example 7 with ProcessInstanceWithVariablesImpl

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl in project camunda-bpm-platform by camunda.

the class TargetVariableScopeTest method testExecutionWithDelegateProcess.

@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/variables/scope/TargetVariableScopeTest.testExecutionWithDelegateProcess.bpmn", "org/camunda/bpm/engine/test/api/variables/scope/doer.bpmn" })
public void testExecutionWithDelegateProcess() {
    // Given we create a new process instance
    VariableMap variables = Variables.createVariables().putValue("orderIds", Arrays.asList(new int[] { 1, 2, 3 }));
    ProcessInstance processInstance = engineRule.getRuntimeService().startProcessInstanceByKey("Process_MultiInstanceCallAcitivity", variables);
    // it runs without any problems
    assertThat(processInstance.isEnded(), is(true));
    assertThat(((ProcessInstanceWithVariablesImpl) processInstance).getVariables().containsKey("targetOrderId"), is(false));
}
Also used : ProcessInstanceWithVariablesImpl(org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl) VariableMap(org.camunda.bpm.engine.variable.VariableMap) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 8 with ProcessInstanceWithVariablesImpl

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl in project camunda-bpm-platform by camunda.

the class TargetVariableScopeTest method testExecutionWithScriptTargetScope.

@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/variables/scope/TargetVariableScopeTest.testExecutionWithScriptTargetScope.bpmn", "org/camunda/bpm/engine/test/api/variables/scope/doer.bpmn" })
public void testExecutionWithScriptTargetScope() {
    VariableMap variables = Variables.createVariables().putValue("orderIds", Arrays.asList(new int[] { 1, 2, 3 }));
    ProcessInstance processInstance = engineRule.getRuntimeService().startProcessInstanceByKey("Process_MultiInstanceCallAcitivity", variables);
    // it runs without any problems
    assertThat(processInstance.isEnded(), is(true));
    assertThat(((ProcessInstanceWithVariablesImpl) processInstance).getVariables().containsKey("targetOrderId"), is(false));
}
Also used : ProcessInstanceWithVariablesImpl(org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl) VariableMap(org.camunda.bpm.engine.variable.VariableMap) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 9 with ProcessInstanceWithVariablesImpl

use of org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl in project camunda-bpm-platform by camunda.

the class FoxFailedJobParseListenerTest method findActivity.

protected ActivityImpl findActivity(ProcessInstance pi, String activityId) {
    ProcessInstanceWithVariablesImpl entity = (ProcessInstanceWithVariablesImpl) pi;
    ProcessDefinitionEntity processDefEntity = entity.getExecutionEntity().getProcessDefinition();
    assertNotNull(processDefEntity);
    ActivityImpl activity = processDefEntity.findActivity(activityId);
    assertNotNull(activity);
    return activity;
}
Also used : ProcessInstanceWithVariablesImpl(org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl) ActivityImpl(org.camunda.bpm.engine.impl.pvm.process.ActivityImpl) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)

Aggregations

ProcessInstanceWithVariablesImpl (org.camunda.bpm.engine.impl.persistence.entity.ProcessInstanceWithVariablesImpl)9 Test (org.junit.Test)6 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)4 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)3 VariableMap (org.camunda.bpm.engine.variable.VariableMap)3 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)2 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)2 ExecutionVariableSnapshotObserver (org.camunda.bpm.engine.impl.persistence.entity.ExecutionVariableSnapshotObserver)2 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)2 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)2 Deployment (org.camunda.bpm.engine.test.Deployment)2 ProcessInstanceModificationBuilderImpl (org.camunda.bpm.engine.impl.ProcessInstanceModificationBuilderImpl)1