use of org.activiti.engine.impl.Condition in project Activiti by Activiti.
the class ConditionUtil method hasTrueCondition.
public static boolean hasTrueCondition(SequenceFlow sequenceFlow, DelegateExecution execution) {
String conditionExpression = null;
if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
ObjectNode elementProperties = Context.getBpmnOverrideElementProperties(sequenceFlow.getId(), execution.getProcessDefinitionId());
conditionExpression = getActiveValue(sequenceFlow.getConditionExpression(), DynamicBpmnConstants.SEQUENCE_FLOW_CONDITION, elementProperties);
} else {
conditionExpression = sequenceFlow.getConditionExpression();
}
if (StringUtils.isNotEmpty(conditionExpression)) {
Expression expression = Context.getProcessEngineConfiguration().getExpressionManager().createExpression(conditionExpression);
Condition condition = new UelExpressionCondition(expression);
if (condition.evaluate(sequenceFlow.getId(), execution)) {
return true;
}
return false;
} else {
return true;
}
}
Aggregations