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


Java Element.elementNS方法代码示例

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


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

示例1: parseProperties

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseProperties(Element formField, FormFieldHandler formFieldHandler, BpmnParse bpmnParse, ExpressionManager expressionManager) {

    Element propertiesElement = formField.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "properties");

    if(propertiesElement != null) {
      List<Element> propertyElements = propertiesElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "property");

      // use linked hash map to preserve item ordering as provided in XML
      Map<String, String> propertyMap = new LinkedHashMap<String, String>();
      for (Element property : propertyElements) {
        String id = property.attribute("id");
        String value = property.attribute("value");
        propertyMap.put(id, value);
      }

      formFieldHandler.setProperties(propertyMap);
    }

  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:DefaultFormHandler.java

示例2: parseValidation

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseValidation(Element formField, FormFieldHandler formFieldHandler, BpmnParse bpmnParse, ExpressionManager expressionManager) {

    Element validationElement = formField.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "validation");

    if(validationElement != null) {
      List<Element> constraintElements = validationElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "constraint");

      for (Element property : constraintElements) {
         FormFieldValidator validator = Context.getProcessEngineConfiguration()
           .getFormValidators()
           .createValidator(property, bpmnParse, expressionManager);

         String validatorName = property.attribute("name");
         String validatorConfig = property.attribute("config");

         if(validator != null) {
           FormFieldValidationConstraintHandler handler = new FormFieldValidationConstraintHandler();
           handler.setName(validatorName);
           handler.setConfig(validatorConfig);
           handler.setValidator(validator);
           formFieldHandler.getValidationHandlers().add(handler);
         }
      }
    }
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:DefaultFormHandler.java

示例3: setFailedJobRetryTimeCycleValue

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void setFailedJobRetryTimeCycleValue(Element element, ActivityImpl activity) {
  String failedJobRetryTimeCycleConfiguration = null;

  Element extensionElements = element.element(EXTENSION_ELEMENTS);
  if (extensionElements != null) {
    Element failedJobRetryTimeCycleElement = extensionElements.elementNS(FOX_ENGINE_NS, FAILED_JOB_RETRY_TIME_CYCLE);
    if (failedJobRetryTimeCycleElement == null) {
      // try to get it from the activiti namespace
      failedJobRetryTimeCycleElement = extensionElements.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, FAILED_JOB_RETRY_TIME_CYCLE);
    }

    if (failedJobRetryTimeCycleElement != null) {
      failedJobRetryTimeCycleConfiguration = failedJobRetryTimeCycleElement.getText();
    }
  }

  if (failedJobRetryTimeCycleConfiguration == null || failedJobRetryTimeCycleConfiguration.isEmpty()) {
    failedJobRetryTimeCycleConfiguration = Context.getProcessEngineConfiguration().getFailedJobRetryTimeCycle();
  }

  if (failedJobRetryTimeCycleConfiguration != null) {
    FailedJobRetryConfiguration configuration = ParseUtil.parseRetryIntervals(failedJobRetryTimeCycleConfiguration);
    activity.getProperties().set(FAILED_JOB_CONFIGURATION, configuration);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:DefaultFailedJobParseListener.java

示例4: getStringValueFromAttributeOrElement

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected String getStringValueFromAttributeOrElement(String attributeName, String elementName, Element element) {
  String value = null;

  String attributeValue = element.attribute(attributeName);
  Element childElement = element.elementNS(CAMUNDA_BPMN_EXTENSIONS_NS, elementName);
  String stringElementText = null;

  if (attributeValue != null && childElement != null) {
    addError("Can't use attribute '" + attributeName + "' and element '" + elementName + "' together, only use one", element);
  } else if (childElement != null) {
    stringElementText = childElement.getText();
    if (stringElementText == null || stringElementText.length() == 0) {
      addError("No valid value found in attribute '" + attributeName + "' nor element '" + elementName + "'", element);
    } else {
      // Use text of element
      value = stringElementText;
    }
  } else if (attributeValue != null && attributeValue.length() > 0) {
    // Using attribute
    value = attributeValue;
  }

  return value;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:BpmnParse.java

示例5: parseFormData

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseFormData(BpmnParse bpmnParse, ExpressionManager expressionManager, Element extensionElement) {
  Element formData = extensionElement.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "formData");
  if(formData != null) {
    this.businessKeyFieldId = formData.attribute(BUSINESS_KEY_ATTRIBUTE);
    parseFormFields(formData, bpmnParse, expressionManager);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:DefaultFormHandler.java

示例6: findCamundaExtensionElement

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Returns the camunda extension element in the camunda namespace
 * and the given name.
 *
  * @param element the parent element of the extension element
 * @param extensionElementName the name of the extension element to find
 * @return the extension element or null if not found
 */
public static Element findCamundaExtensionElement(Element element, String extensionElementName) {
  Element extensionElements = element.element("extensionElements");
  if(extensionElements != null) {
    return extensionElements.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, extensionElementName);
  } else {
    return null;
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:BpmnParseUtil.java

示例7: parseInputOutput

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Returns the {@link IoMapping} of an element.
 *
 * @param element the element to parse
 * @return the input output mapping or null if non defined
 * @throws BpmnParseException if a input/output parameter element is malformed
 */
public static IoMapping parseInputOutput(Element element) {
  Element inputOutputElement = element.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputOutput");
  if(inputOutputElement != null) {
    IoMapping ioMapping = new IoMapping();
    parseCamundaInputParameters(inputOutputElement, ioMapping);
    parseCamundaOutputParameters(inputOutputElement, ioMapping);
    return ioMapping;
  }
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:BpmnParseUtil.java

示例8: parseTaskListener

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected TaskListener parseTaskListener(Element taskListenerElement) {
  TaskListener taskListener = null;

  String className = taskListenerElement.attribute(PROPERTYNAME_CLASS);
  String expression = taskListenerElement.attribute(PROPERTYNAME_EXPRESSION);
  String delegateExpression = taskListenerElement.attribute(PROPERTYNAME_DELEGATE_EXPRESSION);
  Element scriptElement = taskListenerElement.elementNS(CAMUNDA_BPMN_EXTENSIONS_NS, "script");

  if (className != null) {
    taskListener = new ClassDelegateTaskListener(className, parseFieldDeclarations(taskListenerElement));
  } else if (expression != null) {
    taskListener = new ExpressionTaskListener(expressionManager.createExpression(expression));
  } else if (delegateExpression != null) {
    taskListener = new DelegateExpressionTaskListener(expressionManager.createExpression(delegateExpression), parseFieldDeclarations(taskListenerElement));
  } else if (scriptElement != null) {
    try {
      ExecutableScript executableScript = parseCamundaScript(scriptElement);
      if (executableScript != null) {
        taskListener = new ScriptTaskListener(executableScript);
      }
    } catch (BpmnParseException e) {
      addError(e);
    }
  } else {
    addError("Element 'class', 'expression', 'delegateExpression' or 'script' is mandatory on taskListener", taskListenerElement);
  }
  return taskListener;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:29,代码来源:BpmnParse.java

示例9: parseExecutionListener

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses an {@link ExecutionListener} implementation for the given
 * executionListener element.
 *
 * @param executionListenerElement
 *          the XML element containing the executionListener definition.
 */
public ExecutionListener parseExecutionListener(Element executionListenerElement) {
  ExecutionListener executionListener = null;

  String className = executionListenerElement.attribute(PROPERTYNAME_CLASS);
  String expression = executionListenerElement.attribute(PROPERTYNAME_EXPRESSION);
  String delegateExpression = executionListenerElement.attribute(PROPERTYNAME_DELEGATE_EXPRESSION);
  Element scriptElement = executionListenerElement.elementNS(CAMUNDA_BPMN_EXTENSIONS_NS, "script");

  if (className != null) {
    executionListener = new ClassDelegateExecutionListener(className, parseFieldDeclarations(executionListenerElement));
  } else if (expression != null) {
    executionListener = new ExpressionExecutionListener(expressionManager.createExpression(expression));
  } else if (delegateExpression != null) {
    executionListener = new DelegateExpressionExecutionListener(expressionManager.createExpression(delegateExpression),
        parseFieldDeclarations(executionListenerElement));
  } else if (scriptElement != null) {
    try {
      ExecutableScript executableScript = parseCamundaScript(scriptElement);
      if (executableScript != null) {
        executionListener = new ScriptExecutionListener(executableScript);
      }
    } catch (BpmnParseException e) {
      addError(e);
    }
  } else {
    addError("Element 'class', 'expression', 'delegateExpression' or 'script' is mandatory on executionListener", executionListenerElement);
  }
  return executionListener;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:37,代码来源:BpmnParse.java

示例10: parseBPMNDiagram

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public void parseBPMNDiagram(Element bpmndiagramElement) {
  // Each BPMNdiagram needs to have exactly one BPMNPlane
  Element bpmnPlane = bpmndiagramElement.elementNS(BPMN_DI_NS, "BPMNPlane");
  if (bpmnPlane != null) {
    parseBPMNPlane(bpmnPlane);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:BpmnParse.java

示例11: parseDIBounds

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseDIBounds(Element bpmnShapeElement, HasDIBounds target) {
  Element bounds = bpmnShapeElement.elementNS(BPMN_DC_NS, "Bounds");
  if (bounds != null) {
    target.setX(parseDoubleAttribute(bpmnShapeElement, "x", bounds.attribute("x"), true).intValue());
    target.setY(parseDoubleAttribute(bpmnShapeElement, "y", bounds.attribute("y"), true).intValue());
    target.setWidth(parseDoubleAttribute(bpmnShapeElement, "width", bounds.attribute("width"), true).intValue());
    target.setHeight(parseDoubleAttribute(bpmnShapeElement, "height", bounds.attribute("height"), true).intValue());
  } else {
    addError("'Bounds' element is required", bpmnShapeElement);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:12,代码来源:BpmnParse.java


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