Search in sources :

Example 26 with TaskEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity 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());
}
Also used : TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) Date(java.util.Date)

Example 27 with TaskEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.

the class TaskQueryImpl method executeList.

// results ////////////////////////////////////////////////////////////////
@Override
public List<Task> executeList(CommandContext commandContext, Page page) {
    ensureOrExpressionsEvaluated();
    ensureVariablesInitialized();
    checkQueryOk();
    // check if candidateGroup and candidateGroups intersect
    if (getCandidateGroup() != null && getCandidateGroupsInternal() != null && getCandidateGroups().isEmpty()) {
        return Collections.emptyList();
    }
    List<Task> taskList = commandContext.getTaskManager().findTasksByQueryCriteria(this);
    if (initializeFormKeys) {
        for (Task task : taskList) {
            // initialize the form keys of the tasks
            ((TaskEntity) task).initializeFormKey();
        }
    }
    return taskList;
}
Also used : Task(org.camunda.bpm.engine.task.Task) TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 28 with TaskEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.

the class UserTaskActivityBehavior method onParseMigratingInstance.

@Override
public void onParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInstance migratingInstance) {
    ExecutionEntity execution = migratingInstance.resolveRepresentativeExecution();
    for (TaskEntity task : execution.getTasks()) {
        migratingInstance.addMigratingDependentInstance(new MigratingUserTaskInstance(task, migratingInstance));
        parseContext.consume(task);
        Collection<VariableInstanceEntity> variables = task.getVariablesInternal();
        if (variables != null) {
            for (VariableInstanceEntity variable : variables) {
                // we don't need to represent task variables in the migrating instance structure because
                // they are migrated by the MigratingTaskInstance as well
                parseContext.consume(variable);
            }
        }
    }
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) MigratingUserTaskInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingUserTaskInstance) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)

Example 29 with TaskEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.

the class RemoveTaskVariablesCmd method getEntity.

protected TaskEntity getEntity() {
    ensureNotNull("taskId", entityId);
    TaskEntity task = commandContext.getTaskManager().findTaskById(entityId);
    ensureNotNull("Cannot find task with id " + entityId, "task", task);
    checkRemoveTaskVariables(task);
    return task;
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 30 with TaskEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TaskEntity in project camunda-bpm-platform by camunda.

the class RemoveTaskVariablesCmd method logVariableOperation.

protected void logVariableOperation(AbstractVariableScope scope) {
    TaskEntity task = (TaskEntity) scope;
    commandContext.getOperationLogManager().logVariableOperation(getLogEntryOperation(), null, task.getId(), PropertyChange.EMPTY_CHANGE);
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

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