Search in sources :

Example 1 with TaskDecorator

use of org.camunda.bpm.engine.impl.task.TaskDecorator in project camunda-bpm-platform by camunda.

the class BpmnParse method parseUserTask.

/**
 * Parses a userTask declaration.
 */
public ActivityImpl parseUserTask(Element userTaskElement, ScopeImpl scope) {
    ActivityImpl activity = createActivityOnScope(userTaskElement, scope);
    parseAsynchronousContinuationForActivity(userTaskElement, activity);
    TaskDefinition taskDefinition = parseTaskDefinition(userTaskElement, activity.getId(), (ProcessDefinitionEntity) scope.getProcessDefinition());
    TaskDecorator taskDecorator = new TaskDecorator(taskDefinition, expressionManager);
    UserTaskActivityBehavior userTaskActivity = new UserTaskActivityBehavior(taskDecorator);
    activity.setActivityBehavior(userTaskActivity);
    parseProperties(userTaskElement, activity);
    parseExecutionListenersOnScope(userTaskElement, activity);
    for (BpmnParseListener parseListener : parseListeners) {
        parseListener.parseUserTask(userTaskElement, scope, activity);
    }
    return activity;
}
Also used : TaskDecorator(org.camunda.bpm.engine.impl.task.TaskDecorator) TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition)

Example 2 with TaskDecorator

use of org.camunda.bpm.engine.impl.task.TaskDecorator in project camunda-bpm-platform by camunda.

the class TaskDecoratorTest method setUp.

public void setUp() {
    task = (TaskEntity) taskService.newTask();
    taskService.saveTask(task);
    expressionManager = processEngineConfiguration.getExpressionManager();
    taskDefinition = new TaskDefinition(null);
    taskDecorator = new TaskDecorator(taskDefinition, expressionManager);
}
Also used : TaskDecorator(org.camunda.bpm.engine.impl.task.TaskDecorator) TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition)

Example 3 with TaskDecorator

use of org.camunda.bpm.engine.impl.task.TaskDecorator in project camunda-bpm-platform by camunda.

the class HumanTaskItemHandler method initializeActivity.

@Override
protected void initializeActivity(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
    // execute standard initialization
    super.initializeActivity(element, activity, context);
    // create a taskDefinition
    TaskDefinition taskDefinition = createTaskDefinition(element, context);
    // get the caseDefinition...
    CaseDefinitionEntity caseDefinition = (CaseDefinitionEntity) context.getCaseDefinition();
    // ... and taskDefinition to caseDefinition
    caseDefinition.getTaskDefinitions().put(taskDefinition.getKey(), taskDefinition);
    ExpressionManager expressionManager = context.getExpressionManager();
    // create decorator
    TaskDecorator taskDecorator = new TaskDecorator(taskDefinition, expressionManager);
    // set taskDecorator on behavior
    HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
    behavior.setTaskDecorator(taskDecorator);
    // task listeners
    initializeTaskListeners(element, activity, context, taskDefinition);
}
Also used : ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) TaskDecorator(org.camunda.bpm.engine.impl.task.TaskDecorator) TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) HumanTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior)

Aggregations

TaskDecorator (org.camunda.bpm.engine.impl.task.TaskDecorator)3 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)3 HumanTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior)1 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)1 ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)1