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;
}
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);
}
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());
}
Aggregations