use of org.camunda.bpm.engine.impl.el.ExpressionManager 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);
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionCandidateUsers.
protected void initializeTaskDefinitionCandidateUsers(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
ExpressionManager expressionManager = context.getExpressionManager();
List<String> candidateUsers = definition.getCamundaCandidateUsersList();
for (String candidateUser : candidateUsers) {
Expression candidateUserExpression = expressionManager.createExpression(candidateUser);
taskDefinition.addCandidateUserIdExpression(candidateUserExpression);
}
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionCandidateGroups.
protected void initializeTaskDefinitionCandidateGroups(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
ExpressionManager expressionManager = context.getExpressionManager();
List<String> candidateGroups = definition.getCamundaCandidateGroupsList();
for (String candidateGroup : candidateGroups) {
Expression candidateGroupExpression = expressionManager.createExpression(candidateGroup);
taskDefinition.addCandidateGroupIdExpression(candidateGroupExpression);
}
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionDueDate.
protected void initializeTaskDefinitionDueDate(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
String dueDate = definition.getCamundaDueDate();
if (dueDate != null) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression dueDateExpression = expressionManager.createExpression(dueDate);
taskDefinition.setDueDateExpression(dueDateExpression);
}
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDescription.
protected void initializeTaskDescription(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
String description = getDesciption(element);
if (description != null && !description.isEmpty()) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression descriptionExpression = expressionManager.createExpression(description);
taskDefinition.setDescriptionExpression(descriptionExpression);
} else {
String documentation = getDocumentation(element);
if (documentation != null && !documentation.isEmpty()) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression documentationExpression = expressionManager.createExpression(documentation);
taskDefinition.setDescriptionExpression(documentationExpression);
}
}
}
Aggregations