use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.
the class ProcessTaskTest method testCallProcessAsExpressionStartsWithDollar.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testCallProcessAsExpressionStartsWithDollar.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testCallProcessAsExpressionStartsWithDollar() {
// given
// a deployed case definition
String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE, Variables.createVariables().putValue("process", "oneTaskProcess")).getId();
String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId();
// then
// there exists a process instance
ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance();
assertNotNull(processInstance);
// the case instance id is set on called process instance
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());
// the super case execution id is equals the processTaskId
assertEquals(processTaskId, processInstance.getSuperCaseExecutionId());
TaskEntity task = (TaskEntity) queryTask();
// the case instance id has been also set on the task
assertEquals(caseInstanceId, task.getCaseInstanceId());
// the case execution id should be null
assertNull(task.getCaseExecutionId());
// complete ////////////////////////////////////////////////////////
taskService.complete(task.getId());
assertProcessEnded(processInstance.getId());
close(caseInstanceId);
assertCaseEnded(caseInstanceId);
}
use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.
the class ProcessTaskTest method testCallProcessByDeployment.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testCallProcessByDeployment.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testCallProcessByDeployment() {
// given
String firstDeploymentId = repositoryService.createDeploymentQuery().singleResult().getId();
String bpmnResourceName = "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml";
String deploymentId = repositoryService.createDeployment().addClasspathResource(bpmnResourceName).deploy().getId();
assertEquals(2, repositoryService.createProcessDefinitionQuery().count());
String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE).getId();
String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId();
// latest process definition
String processDefinitionIdInSameDeployment = repositoryService.createProcessDefinitionQuery().deploymentId(firstDeploymentId).singleResult().getId();
// then
// there exists a process instance
ExecutionEntity processInstance = (ExecutionEntity) queryProcessInstance();
assertNotNull(processInstance);
// the case instance id is set on called process instance
assertEquals(caseInstanceId, processInstance.getCaseInstanceId());
// the super case execution id is equals the processTaskId
assertEquals(processTaskId, processInstance.getSuperCaseExecutionId());
// it is associated with the correct process definition
assertEquals(processDefinitionIdInSameDeployment, processInstance.getProcessDefinitionId());
TaskEntity task = (TaskEntity) queryTask();
// the case instance id has been also set on the task
assertEquals(caseInstanceId, task.getCaseInstanceId());
// the case execution id should be null
assertNull(task.getCaseExecutionId());
// complete ////////////////////////////////////////////////////////
taskService.complete(task.getId());
assertProcessEnded(processInstance.getId());
close(caseInstanceId);
assertCaseEnded(caseInstanceId);
repositoryService.deleteDeployment(deploymentId, true);
}
use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskServiceAndBeanTest method testRemoveChangeWhenSetBackToTheOrgValue.
public void testRemoveChangeWhenSetBackToTheOrgValue() {
TaskEntity entity = new TaskEntity();
// set an owner (default is null)
entity.setOwner("icke");
// should track this change
assertFalse(entity.getPropertyChanges().isEmpty());
// reset the owner
entity.setOwner(null);
// the change is removed
assertTrue(entity.getPropertyChanges().isEmpty());
}
use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.
the class UserOperationLogTaskServiceAndBeanTest method testNotTrackChangeToTheSameValue.
public void testNotTrackChangeToTheSameValue() {
TaskEntity entity = new TaskEntity();
// get and set a properties
entity.setPriority(entity.getPriority());
entity.setOwner(entity.getOwner());
entity.setFollowUpDate(entity.getFollowUpDate());
// should not track this change
assertTrue(entity.getPropertyChanges().isEmpty());
}
use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity 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");
}
Aggregations