Search in sources :

Example 11 with ProcessDefinitionImpl

use of org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl in project camunda-bpm-platform by camunda.

the class EventSubscriptionEntity method getActivity.

public ActivityImpl getActivity() {
    if (activity == null && activityId != null) {
        ProcessDefinitionImpl processDefinition = getProcessDefinition();
        activity = processDefinition.findActivity(activityId);
    }
    return activity;
}
Also used : ProcessDefinitionImpl(org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)

Example 12 with ProcessDefinitionImpl

use of org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl in project camunda-bpm-platform by camunda.

the class JobEntity method insert.

public void insert() {
    CommandContext commandContext = Context.getCommandContext();
    // add link to execution and deployment
    ExecutionEntity execution = getExecution();
    if (execution != null) {
        execution.addJob(this);
        ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
        this.deploymentId = processDefinition.getDeploymentId();
    }
    commandContext.getJobManager().insertJob(this);
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) ProcessDefinitionImpl(org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)

Example 13 with ProcessDefinitionImpl

use of org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl in project camunda-bpm-platform by camunda.

the class EntitySerializationTest method testExecutionEntitySerialization.

public void testExecutionEntitySerialization() throws Exception {
    ExecutionEntity execution = new ExecutionEntity();
    ActivityImpl activityImpl = new ActivityImpl("test", null);
    activityImpl.getExecutionListeners().put("start", Collections.<ExecutionListener>singletonList(new TestExecutionListener()));
    execution.setActivity(activityImpl);
    ProcessDefinitionImpl processDefinitionImpl = new ProcessDefinitionImpl("test");
    processDefinitionImpl.getExecutionListeners().put("start", Collections.<ExecutionListener>singletonList(new TestExecutionListener()));
    execution.setProcessDefinition(processDefinitionImpl);
    TransitionImpl transitionImpl = new TransitionImpl("test", new ProcessDefinitionImpl("test"));
    transitionImpl.addExecutionListener(new TestExecutionListener());
    execution.setTransition(transitionImpl);
    execution.getProcessInstanceStartContext().setInitial(activityImpl);
    execution.setSuperExecution(new ExecutionEntity());
    execution.setActive(true);
    execution.setCanceled(false);
    execution.setBusinessKey("myBusinessKey");
    execution.setDeleteReason("no reason");
    execution.setActivityInstanceId("123");
    execution.setScope(false);
    byte[] data = writeObject(execution);
    execution = (ExecutionEntity) readObject(data);
    assertEquals("myBusinessKey", execution.getBusinessKey());
    assertEquals("no reason", execution.getDeleteReason());
    assertEquals("123", execution.getActivityInstanceId());
}
Also used : TransitionImpl(org.camunda.bpm.engine.impl.pvm.process.TransitionImpl) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) ActivityImpl(org.camunda.bpm.engine.impl.pvm.process.ActivityImpl) ProcessDefinitionImpl(org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)

Aggregations

ProcessDefinitionImpl (org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)13 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)6 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)4 PvmProcessInstance (org.camunda.bpm.engine.impl.pvm.PvmProcessInstance)4 ArrayList (java.util.ArrayList)2 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)2 ProcessDefinitionBuilder (org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder)2 PvmActivity (org.camunda.bpm.engine.impl.pvm.PvmActivity)2 PvmProcessDefinition (org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition)2 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)2 ScopeImpl (org.camunda.bpm.engine.impl.pvm.process.ScopeImpl)2 TransitionImpl (org.camunda.bpm.engine.impl.pvm.process.TransitionImpl)2 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)2 Automatic (org.camunda.bpm.engine.test.standalone.pvm.activities.Automatic)2 EmbeddedSubProcess (org.camunda.bpm.engine.test.standalone.pvm.activities.EmbeddedSubProcess)2 End (org.camunda.bpm.engine.test.standalone.pvm.activities.End)2 HashSet (java.util.HashSet)1 NotValidException (org.camunda.bpm.engine.exception.NotValidException)1 ActivityExecutionTreeMapping (org.camunda.bpm.engine.impl.ActivityExecutionTreeMapping)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1