return parseServiceTask(businessRuleTaskElement, scope);
}
else {
ActivityImpl activity = createActivityOnScope(businessRuleTaskElement, scope);
BusinessRuleTaskActivityBehavior ruleActivity = new BusinessRuleTaskActivityBehavior();
String ruleVariableInputString = businessRuleTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "ruleVariablesInput");
String rulesString = businessRuleTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "rules");
String excludeString = businessRuleTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "exclude");
String resultVariableNameString = businessRuleTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "resultVariable");
activity.setAsync(isAsync(businessRuleTaskElement));
activity.setExclusive(isExclusive(businessRuleTaskElement));
if (resultVariableNameString == null) {
resultVariableNameString = businessRuleTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "resultVariableName");
}
if (ruleVariableInputString != null) {
List<String> ruleVariableInputObjects = parseCommaSeparatedList(ruleVariableInputString);
for (String ruleVariableInputObject : ruleVariableInputObjects) {
ruleActivity.addRuleVariableInputIdExpression(expressionManager.createExpression(ruleVariableInputObject.trim()));
}
}
if (rulesString != null) {
List<String> rules = parseCommaSeparatedList(rulesString);
for (String rule : rules) {
ruleActivity.addRuleIdExpression(expressionManager.createExpression(rule.trim()));
}
if (excludeString != null) {
excludeString = excludeString.trim();
if ("true".equalsIgnoreCase(excludeString) == false && "false".equalsIgnoreCase(excludeString) == false) {
addError("'exclude' only supports true or false for business rule tasks", businessRuleTaskElement);
} else {
ruleActivity.setExclude(Boolean.valueOf(excludeString.toLowerCase()));
}
}
} else if (excludeString != null) {
addError("'exclude' not supported for business rule tasks not defining 'rules'", businessRuleTaskElement);
}
if (resultVariableNameString != null) {
resultVariableNameString = resultVariableNameString.trim();
if (resultVariableNameString.length() > 0 == false) {
addError("'resultVariable' must contain a text value for business rule tasks", businessRuleTaskElement);
} else {
ruleActivity.setResultVariable(resultVariableNameString);
}
} else {
ruleActivity.setResultVariable("org.activiti.engine.rules.OUTPUT");
}
activity.setActivityBehavior(ruleActivity);
parseExecutionListenersOnScope(businessRuleTaskElement, activity);