use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class DbOperationsOrderingTest method setup.
@Before
public void setup() {
TestIdGenerator idGenerator = new TestIdGenerator();
entityManager = new ExposingDbEntityManager(idGenerator, null);
execution1 = new ExecutionEntity();
execution1.setId("101");
execution2 = new ExecutionEntity();
execution2.setId("102");
execution3 = new ExecutionEntity();
execution3.setId("103");
execution4 = new ExecutionEntity();
execution4.setId("104");
execution5 = new ExecutionEntity();
execution5.setId("105");
execution6 = new ExecutionEntity();
execution6.setId("106");
execution7 = new ExecutionEntity();
execution7.setId("107");
execution8 = new ExecutionEntity();
execution8.setId("108");
task1 = new TaskEntity();
task1.setId("104");
task2 = new TaskEntity();
task2.setId("105");
task3 = new TaskEntity();
task3.setId("106");
task4 = new TaskEntity();
task4.setId("107");
variable1 = new VariableInstanceEntity();
variable1.setId("108");
variable2 = new VariableInstanceEntity();
variable2.setId("109");
variable3 = new VariableInstanceEntity();
variable3.setId("110");
variable4 = new VariableInstanceEntity();
variable4.setId("111");
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class EntitySerializationTest method testTaskEntitySerialization.
public void testTaskEntitySerialization() throws Exception {
TaskEntity task = new TaskEntity();
task.setDelegationState(DelegationState.RESOLVED);
task.setExecution(new ExecutionEntity());
task.setProcessInstance(new ExecutionEntity());
task.setTaskDefinition(new TaskDefinition(null));
task.setAssignee("kermit");
task.setCreateTime(new Date());
task.setDescription("Test description");
task.setDueDate(new Date());
task.setName("myTask");
task.setEventName("end");
task.setDeleted(false);
task.setDelegationStateString(DelegationState.RESOLVED.name());
byte[] data = writeObject(task);
task = (TaskEntity) readObject(data);
assertEquals("kermit", task.getAssignee());
assertEquals("myTask", task.getName());
assertEquals("end", task.getEventName());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class ViolateIntegrityConstraintDelegate method execute.
public void execute(DelegateExecution execution) throws Exception {
String existingId = execution.getId();
// insert an execution referencing the current execution
ExecutionEntity newExecution = new ExecutionEntity();
newExecution.setId("someId");
newExecution.setParentId(existingId);
DbEntityOperation insertOperation = new DbEntityOperation();
insertOperation.setOperationType(DbOperationType.INSERT);
insertOperation.setEntity(newExecution);
Context.getCommandContext().getDbSqlSession().executeDbOperation(insertOperation);
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class ExecutionCachedEntityStateTest method testProcessInstanceTasks.
@Deployment
public void testProcessInstanceTasks() {
runtimeService.startProcessInstanceByKey("testProcess");
ExecutionEntity processInstance = (ExecutionEntity) runtimeService.createProcessInstanceQuery().singleResult();
assertEquals(BitMaskUtil.getMaskForBit(ExecutionEntity.TASKS_STATE_BIT), processInstance.getCachedEntityStateRaw());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity in project camunda-bpm-platform by camunda.
the class ExecutionCachedEntityStateTest method testExecutionJobsScope.
@Deployment
public void testExecutionJobsScope() {
runtimeService.startProcessInstanceByKey("testProcess");
ExecutionEntity processInstance = (ExecutionEntity) runtimeService.createProcessInstanceQuery().singleResult();
assertEquals(0, processInstance.getCachedEntityStateRaw());
ExecutionEntity execution = (ExecutionEntity) runtimeService.createExecutionQuery().activityId("userTask").singleResult();
assertEquals(BitMaskUtil.getMaskForBit(ExecutionEntity.JOBS_STATE_BIT), execution.getCachedEntityStateRaw());
}
Aggregations