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