Package org.activiti.engine.impl.bpmn.behavior

Examples of org.activiti.engine.impl.bpmn.behavior.BusinessRuleTaskActivityBehavior


    List<FieldDeclaration> fieldDeclarations = createFieldDeclarations(serviceTask.getFieldExtensions());
    return (ShellActivityBehavior) ClassDelegate.instantiateDelegate(ShellActivityBehavior.class, fieldDeclarations);
  }
 
  public BusinessRuleTaskActivityBehavior createBusinessRuleTaskActivityBehavior(BusinessRuleTask businessRuleTask) {
    BusinessRuleTaskActivityBehavior ruleActivity = new BusinessRuleTaskActivityBehavior();
   
    for (String ruleVariableInputObject : businessRuleTask.getInputVariables()) {
      ruleActivity.addRuleVariableInputIdExpression(expressionManager.createExpression(ruleVariableInputObject.trim()));
    }

    for (String rule : businessRuleTask.getRuleNames()) {
      ruleActivity.addRuleIdExpression(expressionManager.createExpression(rule.trim()));
    }

    ruleActivity.setExclude(businessRuleTask.isExclude());

    if (businessRuleTask.getResultVariableName() != null && businessRuleTask.getResultVariableName().length() > 0) {
      ruleActivity.setResultVariable(businessRuleTask.getResultVariableName());
    } else {
      ruleActivity.setResultVariable("org.activiti.engine.rules.OUTPUT");
    }
   
    return ruleActivity;
  }
View Full Code Here


      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);
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.bpmn.behavior.BusinessRuleTaskActivityBehavior

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.