Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.BusinessRuleTask


  protected String getStencilId(FlowElement flowElement) {
    return STENCIL_TASK_BUSINESS_RULE;
  }
 
  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    BusinessRuleTask ruleTask = (BusinessRuleTask) flowElement;
    propertiesNode.put(PROPERTY_RULETASK_CLASS, ruleTask.getClassName());
    propertiesNode.put(PROPERTY_RULETASK_VARIABLES_INPUT, convertListToCommaSeparatedString(ruleTask.getInputVariables()));
    propertiesNode.put(PROPERTY_RULETASK_RESULT, ruleTask.getResultVariableName());
    propertiesNode.put(PROPERTY_RULETASK_RULES, convertListToCommaSeparatedString(ruleTask.getRuleNames()));
    if (ruleTask.isExclude()) {
      propertiesNode.put(PROPERTY_RULETASK_EXCLUDE, PROPERTY_VALUE_YES);
    }
  }
View Full Code Here


      propertiesNode.put(PROPERTY_RULETASK_EXCLUDE, PROPERTY_VALUE_YES);
    }
  }
 
  protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    BusinessRuleTask task = new BusinessRuleTask();
    task.setClassName(getPropertyValueAsString(PROPERTY_RULETASK_CLASS, elementNode));
    task.setInputVariables(getPropertyValueAsList(PROPERTY_RULETASK_VARIABLES_INPUT, elementNode));
    task.setResultVariableName(getPropertyValueAsString(PROPERTY_RULETASK_RESULT, elementNode));
    task.setRuleNames(getPropertyValueAsList(PROPERTY_RULETASK_RULES, elementNode));
    task.setExclude(getPropertyValueAsBoolean(PROPERTY_RULETASK_EXCLUDE, elementNode));
    return task;
  }
View Full Code Here

    return ELEMENT_TASK_BUSINESSRULE;
  }
 
  @Override
  protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception {
    BusinessRuleTask businessRuleTask = new BusinessRuleTask();
    BpmnXMLUtil.addXMLLocation(businessRuleTask, xtr);
    businessRuleTask.setInputVariables(parseDelimitedList(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_VARIABLES_INPUT)));
    businessRuleTask.setRuleNames(parseDelimitedList(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_RULES)));
    businessRuleTask.setResultVariableName(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_RESULT_VARIABLE));
    businessRuleTask.setClassName(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_CLASS));
    String exclude = xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_EXCLUDE);
    if (ATTRIBUTE_VALUE_TRUE.equalsIgnoreCase(exclude)) {
      businessRuleTask.setExclude(true);
    }
    parseChildElements(getXMLElementName(), businessRuleTask, model, xtr);
    return businessRuleTask;
  }
View Full Code Here

    return businessRuleTask;
  }

  @Override
  protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception {
    BusinessRuleTask businessRuleTask = (BusinessRuleTask) element;
    String inputVariables = convertToDelimitedString(businessRuleTask.getInputVariables());
    if (StringUtils.isNotEmpty(inputVariables)) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_VARIABLES_INPUT, inputVariables, xtw);
    }
    String ruleNames = convertToDelimitedString(businessRuleTask.getRuleNames());
    if (StringUtils.isNotEmpty(ruleNames)) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_RULES, ruleNames, xtw);
    }
    if (StringUtils.isNotEmpty(businessRuleTask.getResultVariableName())) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_RESULT_VARIABLE, businessRuleTask.getResultVariableName(), xtw);
    }
    if (StringUtils.isNotEmpty(businessRuleTask.getClassName())) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_CLASS, businessRuleTask.getClassName(), xtw);
    }
    if (businessRuleTask.isExclude()) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_EXCLUDE, ATTRIBUTE_VALUE_TRUE, xtw);
    }
  }
View Full Code Here

    if (pe != null) {
      Object bo = getBusinessObject(pe);
      if (bo == null)
        return;

      BusinessRuleTask businessRuleTask = (BusinessRuleTask) bo;
     
      ruleNamesText.setText("");
      if(businessRuleTask.getRuleNames().size() > 0) {
        StringBuilder ruleNameBuilder = new StringBuilder();
        for (String ruleName: businessRuleTask.getRuleNames()) {
          if(ruleNameBuilder.length() > 0) {
            ruleNameBuilder.append(",");
          }
          ruleNameBuilder.append(ruleName);
        }
        ruleNamesText.setText(ruleNameBuilder.toString());
      }
     
      inputVariableNamesText.setText("");
      if(businessRuleTask.getInputVariables().size() > 0) {
        StringBuilder inputBuilder = new StringBuilder();
        for (String input: businessRuleTask.getInputVariables()) {
          if(inputBuilder.length() > 0) {
            inputBuilder.append(",");
          }
          inputBuilder.append(input);
        }
        inputVariableNamesText.setText(inputBuilder.toString());
      }
     
      excludedButton.setSelection(businessRuleTask.isExclude());
      nonExcludedButton.setSelection(!businessRuleTask.isExclude());
     
      resultVariableNameText.setText("");
      if(businessRuleTask.getResultVariableName() != null && businessRuleTask.getResultVariableName().length() > 0) {
        resultVariableNameText.setText(businessRuleTask.getResultVariableName());
      }
     
      ruleNamesText.addFocusListener(listener);
      excludedButton.addFocusListener(listener);
      nonExcludedButton.addFocusListener(listener);
View Full Code Here

    return ELEMENT_TASK_BUSINESSRULE;
  }
 
  @Override
  protected BaseElement convertXMLToElement(XMLStreamReader xtr) throws Exception {
    BusinessRuleTask businessRuleTask = new BusinessRuleTask();
    businessRuleTask.setInputVariables(parseDelimitedList(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_VARIABLES_INPUT)));
    businessRuleTask.setRuleNames(parseDelimitedList(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_RULES)));
    businessRuleTask.setResultVariableName(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_RESULT_VARIABLE));
    businessRuleTask.setClassName(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_CLASS));
    String exclude = xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_TASK_RULE_EXCLUDE);
    if (ATTRIBUTE_VALUE_TRUE.equalsIgnoreCase(exclude)) {
      businessRuleTask.setExclude(true);
    }
    parseChildElements(getXMLElementName(), businessRuleTask, xtr);
    return businessRuleTask;
  }
View Full Code Here

    return businessRuleTask;
  }

  @Override
  protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception {
    BusinessRuleTask businessRuleTask = (BusinessRuleTask) element;
    String inputVariables = convertToDelimitedString(businessRuleTask.getInputVariables());
    if (StringUtils.isNotEmpty(inputVariables)) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_VARIABLES_INPUT, inputVariables, xtw);
    }
    String ruleNames = convertToDelimitedString(businessRuleTask.getRuleNames());
    if (StringUtils.isNotEmpty(ruleNames)) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_RULES, ruleNames, xtw);
    }
    if (StringUtils.isNotEmpty(businessRuleTask.getResultVariableName())) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_RESULT_VARIABLE, businessRuleTask.getResultVariableName(), xtw);
    }
    if (StringUtils.isNotEmpty(businessRuleTask.getClassName())) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_CLASS, businessRuleTask.getClassName(), xtw);
    }
    if (businessRuleTask.isExclude()) {
      writeQualifiedAttribute(ATTRIBUTE_TASK_RULE_EXCLUDE, ATTRIBUTE_VALUE_TRUE, xtw);
    }
  }
View Full Code Here

  protected String getStencilId(FlowElement flowElement) {
    return STENCIL_TASK_BUSINESS_RULE;
  }
 
  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    BusinessRuleTask ruleTask = (BusinessRuleTask) flowElement;
    propertiesNode.put(PROPERTY_RULETASK_CLASS, ruleTask.getClassName());
    propertiesNode.put(PROPERTY_RULETASK_VARIABLES_INPUT, convertListToCommaSeparatedString(ruleTask.getInputVariables()));
    propertiesNode.put(PROPERTY_RULETASK_RESULT, ruleTask.getResultVariableName());
    propertiesNode.put(PROPERTY_RULETASK_RULES, convertListToCommaSeparatedString(ruleTask.getRuleNames()));
    if (ruleTask.isExclude()) {
      propertiesNode.put(PROPERTY_RULETASK_EXCLUDE, PROPERTY_VALUE_YES);
    }
  }
View Full Code Here

      propertiesNode.put(PROPERTY_RULETASK_EXCLUDE, PROPERTY_VALUE_YES);
    }
  }
 
  protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    BusinessRuleTask task = new BusinessRuleTask();
    task.setClassName(getPropertyValueAsString(PROPERTY_RULETASK_CLASS, elementNode));
    task.setInputVariables(getPropertyValueAsList(PROPERTY_RULETASK_VARIABLES_INPUT, elementNode));
    task.setResultVariableName(getPropertyValueAsString(PROPERTY_RULETASK_RESULT, elementNode));
    task.setRuleNames(getPropertyValueAsList(PROPERTY_RULETASK_RULES, elementNode));
    task.setExclude(getPropertyValueAsBoolean(PROPERTY_RULETASK_EXCLUDE, elementNode));
    return task;
  }
View Full Code Here

    super(fp, "BusinessRuleTask", "Add business rule task");
  }

  @Override
  public Object[] create(ICreateContext context) {
    BusinessRuleTask newBusinessRuleTask = new BusinessRuleTask();
    addObjectToContainer(context, newBusinessRuleTask, "Business rule task");

    return new Object[] { newBusinessRuleTask };
  }
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.BusinessRuleTask

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.