Search in sources :

Example 21 with TaskEntity

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);
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 22 with TaskEntity

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);
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 23 with TaskEntity

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());
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 24 with TaskEntity

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());
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 25 with TaskEntity

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");
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity) Before(org.junit.Before)

Aggregations

TaskEntity (org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)53 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)17 Deployment (org.camunda.bpm.engine.test.Deployment)11 TaskManager (org.camunda.bpm.engine.impl.persistence.entity.TaskManager)10 Date (java.util.Date)4 PropertyChange (org.camunda.bpm.engine.impl.persistence.entity.PropertyChange)4 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)3 TaskFormHandler (org.camunda.bpm.engine.impl.form.handler.TaskFormHandler)3 ExternalTaskEntity (org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity)3 VariableInstanceEntity (org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)3 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)3 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 TaskFormData (org.camunda.bpm.engine.form.TaskFormData)2 HistoryEvent (org.camunda.bpm.engine.impl.history.event.HistoryEvent)2 AttachmentEntity (org.camunda.bpm.engine.impl.persistence.entity.AttachmentEntity)2 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)2 Task (org.camunda.bpm.engine.task.Task)2 VariableMapImpl (org.camunda.bpm.engine.variable.impl.VariableMapImpl)2 TypedValue (org.camunda.bpm.engine.variable.value.TypedValue)2 Before (org.junit.Before)2