当前位置: 首页>>代码示例>>Java>>正文


Java BusinessRuleTask.getRuleNames方法代码示例

本文整理汇总了Java中org.eclipse.bpmn2.BusinessRuleTask.getRuleNames方法的典型用法代码示例。如果您正苦于以下问题:Java BusinessRuleTask.getRuleNames方法的具体用法?Java BusinessRuleTask.getRuleNames怎么用?Java BusinessRuleTask.getRuleNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.bpmn2.BusinessRuleTask的用法示例。


在下文中一共展示了BusinessRuleTask.getRuleNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBusinessRuleTaskString

import org.eclipse.bpmn2.BusinessRuleTask; //导入方法依赖的package包/类
/**
 * Writes the rule names, input variables, excluded and result variable
 * properties of a BusinessRuleTask to a String.
 *
 * @param businessRuleTask
 *            The BusinessRuleTask for which the String should be generated.
 * @return The properties represented as a String.
 */
public static String createBusinessRuleTaskString(
    BusinessRuleTask businessRuleTask) {
    String res = "";
    boolean first = true;

    if (businessRuleTask.getRuleNames().size() > 0) {
        StringBuilder ruleNameBuilder = new StringBuilder();
        for (String ruleName : businessRuleTask.getRuleNames()) {
            if (ruleNameBuilder.length() > 0) {
                ruleNameBuilder.append(",");
            }
            ruleNameBuilder.append(ruleName);
        }
        res += "rules: " + ruleNameBuilder.toString();
        first = false;
    }

    if (businessRuleTask.getInputVariables().size() > 0) {
        StringBuilder inputBuilder = new StringBuilder();
        for (String input : businessRuleTask.getInputVariables()) {
            if (inputBuilder.length() > 0) {
                inputBuilder.append(",");
            }
            inputBuilder.append(input);
        }
        if (!first)
            res += "<br>";
        res += "input variables: " + inputBuilder.toString();
        if (first)
            first = false;
    }

    if (businessRuleTask.getRuleNames().size() > 0) {
        if (!first)
            res += "<br>";
        res += "excluded: " + businessRuleTask.isExclude();
        if (first)
            first = false;
    }

    if (businessRuleTask.getResultVariableName() != null
            && businessRuleTask.getResultVariableName().length() > 0) {
        if (!first)
            res += "<br>";
        res += "result variable: "
               + businessRuleTask.getResultVariableName();
    }

    return res;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:59,代码来源:PropertiesStringBuilder.java

示例2: refresh

import org.eclipse.bpmn2.BusinessRuleTask; //导入方法依赖的package包/类
@Override
public void refresh() {
  ruleNamesText.removeFocusListener(listener);
  excludedButton.removeFocusListener(listener);
  nonExcludedButton.removeFocusListener(listener);
  inputVariableNamesText.removeFocusListener(listener);
  resultVariableNameText.removeFocusListener(listener);
  PictogramElement pe = getSelectedPictogramElement();
  if (pe != null) {
    Object bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(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);
    inputVariableNamesText.addFocusListener(listener);
    resultVariableNameText.addFocusListener(listener);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:55,代码来源:PropertyBusinessRuleTaskSection.java

示例3: createBusinessRuleTask

import org.eclipse.bpmn2.BusinessRuleTask; //导入方法依赖的package包/类
public static void createBusinessRuleTask(EObject object, XMLStreamWriter xtw) throws Exception {
  BusinessRuleTask businessRuleTask = (BusinessRuleTask) object;
  // start BusinessRuleTask element
  xtw.writeStartElement("businessRuleTask");
  xtw.writeAttribute("id", businessRuleTask.getId());
  if (businessRuleTask.getName() != null) {
    xtw.writeAttribute("name", businessRuleTask.getName());
  }
  DefaultFlowExport.createDefaultFlow(object, xtw);
  AsyncActivityExport.createDefaultFlow(object, xtw);
  if(businessRuleTask.getRuleNames().size() > 0) {
    StringBuilder ruleNameBuilder = new StringBuilder();
    for (String ruleName: businessRuleTask.getRuleNames()) {
      if(ruleNameBuilder.length() > 0) {
        ruleNameBuilder.append(",");
      }
      ruleNameBuilder.append(ruleName);
    }
    xtw.writeAttribute(ACTIVITI_EXTENSIONS_PREFIX, ACTIVITI_EXTENSIONS_NAMESPACE, 
            "rules", ruleNameBuilder.toString());
  }
  
  if(businessRuleTask.getInputVariables().size() > 0) {
    StringBuilder inputBuilder = new StringBuilder();
    for (String input: businessRuleTask.getInputVariables()) {
      if(inputBuilder.length() > 0) {
        inputBuilder.append(",");
      }
      inputBuilder.append(input);
    }
    xtw.writeAttribute(ACTIVITI_EXTENSIONS_PREFIX, ACTIVITI_EXTENSIONS_NAMESPACE, 
            "ruleVariablesInput", inputBuilder.toString());
  }
  
  if(businessRuleTask.getRuleNames().size() > 0) {
    xtw.writeAttribute(ACTIVITI_EXTENSIONS_PREFIX, ACTIVITI_EXTENSIONS_NAMESPACE, 
            "exclude", "" + businessRuleTask.isExclude());
  }
  
  if(businessRuleTask.getResultVariableName() != null && businessRuleTask.getResultVariableName().length() > 0) {
    xtw.writeAttribute(ACTIVITI_EXTENSIONS_PREFIX, ACTIVITI_EXTENSIONS_NAMESPACE, 
            "resultVariableName", businessRuleTask.getResultVariableName());
  }
  
  MultiInstanceExport.createMultiInstance(object, xtw);

  // end BusinessRuleTask element
  xtw.writeEndElement();
  
  if(businessRuleTask.getBoundaryEventRefs().size() > 0) {
  	for(BoundaryEvent event : businessRuleTask.getBoundaryEventRefs()) {
  		BoundaryEventExport.createBoundaryEvent(event, xtw);
  	}
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:56,代码来源:BusinessRuleTaskExport.java


注:本文中的org.eclipse.bpmn2.BusinessRuleTask.getRuleNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。