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