use of org.camunda.bpm.engine.delegate.Expression 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.delegate.Expression 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);
}
}
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionFormKey.
protected void initializeTaskDefinitionFormKey(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
String formKey = definition.getCamundaFormKey();
if (formKey != null) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression formKeyExpression = expressionManager.createExpression(formKey);
taskDefinition.setFormKey(formKeyExpression);
}
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionPriority.
protected void initializeTaskDefinitionPriority(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
String priority = definition.getCamundaPriority();
if (priority != null) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression priorityExpression = expressionManager.createExpression(priority);
taskDefinition.setPriorityExpression(priorityExpression);
}
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class TaskDecorator method initializeTaskCandidateUsers.
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void initializeTaskCandidateUsers(TaskEntity task, VariableScope variableScope) {
Set<Expression> candidateUserIdExpressions = taskDefinition.getCandidateUserIdExpressions();
for (Expression userIdExpr : candidateUserIdExpressions) {
Object value = userIdExpr.getValue(variableScope);
if (value instanceof String) {
List<String> candiates = extractCandidates((String) value);
task.addCandidateUsers(candiates);
} else if (value instanceof Collection) {
task.addCandidateUsers((Collection) value);
} else {
throw new ProcessEngineException("Expression did not resolve to a string or collection of strings");
}
}
}
Aggregations