Search in sources :

Example 11 with TaskEntity

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

the class CmmnExecution method createTask.

public TaskEntity createTask(TaskDecorator taskDecorator) {
    TaskEntity task = TaskEntity.createAndInsert(this);
    setTask(task);
    taskDecorator.decorate(task, this);
    Context.getCommandContext().getHistoricTaskInstanceManager().createHistoricTask(task);
    // All properties set, now firing 'create' event
    task.fireEvent(TaskListener.EVENTNAME_CREATE);
    return task;
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 12 with TaskEntity

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

the class CaseExecutionEntity method createTask.

public TaskEntity createTask(TaskDecorator taskDecorator) {
    TaskEntity task = super.createTask(taskDecorator);
    fireHistoricCaseActivityInstanceUpdate();
    return task;
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 13 with TaskEntity

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

the class GetTaskFormCmd method execute.

public TaskFormData execute(CommandContext commandContext) {
    TaskManager taskManager = commandContext.getTaskManager();
    TaskEntity task = taskManager.findTaskById(taskId);
    ensureNotNull("No task found for taskId '" + taskId + "'", "task", task);
    for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
        checker.checkReadTask(task);
    }
    if (task.getTaskDefinition() != null) {
        TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
        ensureNotNull("No taskFormHandler specified for task '" + taskId + "'", "taskFormHandler", taskFormHandler);
        return taskFormHandler.createTaskForm(task);
    } else {
        // Standalone task, no TaskFormData available
        return null;
    }
}
Also used : TaskManager(org.camunda.bpm.engine.impl.persistence.entity.TaskManager) TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity) TaskFormHandler(org.camunda.bpm.engine.impl.form.handler.TaskFormHandler) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 14 with TaskEntity

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

the class GetTaskVariableCmd method execute.

public Object execute(CommandContext commandContext) {
    ensureNotNull("taskId", taskId);
    ensureNotNull("variableName", variableName);
    TaskEntity task = Context.getCommandContext().getTaskManager().findTaskById(taskId);
    ensureNotNull("task " + taskId + " doesn't exist", "task", task);
    checkGetTaskVariable(task, commandContext);
    Object value;
    if (isLocal) {
        value = task.getVariableLocal(variableName);
    } else {
        value = task.getVariable(variableName);
    }
    return value;
}
Also used : TaskEntity(org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)

Example 15 with TaskEntity

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

the class GetTaskVariablesCmd method execute.

public VariableMap execute(CommandContext commandContext) {
    ensureNotNull("taskId", taskId);
    TaskEntity task = Context.getCommandContext().getTaskManager().findTaskById(taskId);
    ensureNotNull("task " + taskId + " doesn't exist", "task", task);
    checkGetTaskVariables(task, commandContext);
    VariableMapImpl variables = new VariableMapImpl();
    // collect variables from task
    task.collectVariables(variables, variableNames, isLocal, deserializeValues);
    return variables;
}
Also used : VariableMapImpl(org.camunda.bpm.engine.variable.impl.VariableMapImpl) 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