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


Java Element.elementsNS方法代码示例

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


在下文中一共展示了Element.elementsNS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: parseFieldDeclarations

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public List<FieldDeclaration> parseFieldDeclarations(Element element) {
  List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>();

  Element elementWithFieldInjections = element.element("extensionElements");
  if (elementWithFieldInjections == null) { // Custom extensions will just
                                            // have the <field.. as a
                                            // subelement
    elementWithFieldInjections = element;
  }
  List<Element> fieldDeclarationElements = elementWithFieldInjections.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "field");
  if (fieldDeclarationElements != null && !fieldDeclarationElements.isEmpty()) {

    for (Element fieldDeclarationElement : fieldDeclarationElements) {
      FieldDeclaration fieldDeclaration = parseFieldDeclaration(element, fieldDeclarationElement);
      if (fieldDeclaration != null) {
        fieldDeclarations.add(fieldDeclaration);
      }
    }
  }

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

示例4: parseTaskListeners

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseTaskListeners(Element userTaskElement, TaskDefinition taskDefinition) {
  Element extentionsElement = userTaskElement.element("extensionElements");
  if (extentionsElement != null) {
    List<Element> taskListenerElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "taskListener");
    for (Element taskListenerElement : taskListenerElements) {
      String eventName = taskListenerElement.attribute("event");
      if (eventName != null) {
        if (TaskListener.EVENTNAME_CREATE.equals(eventName) || TaskListener.EVENTNAME_ASSIGNMENT.equals(eventName)
            || TaskListener.EVENTNAME_COMPLETE.equals(eventName) || TaskListener.EVENTNAME_DELETE.equals(eventName)) {
          TaskListener taskListener = parseTaskListener(taskListenerElement);
          taskDefinition.addTaskListener(eventName, taskListener);
        } else {
          addError("Attribute 'event' must be one of {create|assignment|complete|delete}", userTaskElement);
        }
      } else {
        addError("Attribute 'event' is mandatory on taskListener", userTaskElement);
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:BpmnParse.java

示例5: parseInputParameter

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseInputParameter(Element callActivityElement, ActivityImpl activity, CallableElement callableElement) {
  Element extensionsElement = callActivityElement.element("extensionElements");

  if (extensionsElement != null) {
    // input data elements
    for (Element inElement : extensionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "in")) {

      String businessKey = inElement.attribute("businessKey");

      if (businessKey != null && !businessKey.isEmpty()) {
        ParameterValueProvider businessKeyValueProvider = createParameterValueProvider(businessKey, expressionManager);
        callableElement.setBusinessKeyValueProvider(businessKeyValueProvider);

      } else {

        CallableElementParameter parameter = parseCallableElementProvider(inElement);

        if (attributeValueEquals(inElement, "local", TRUE)) {
          parameter.setReadLocal(true);
        }

        callableElement.addInput(parameter);
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:BpmnParse.java

示例6: parseOutputParameter

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseOutputParameter(Element callActivityElement, ActivityImpl activity, CallableElement callableElement) {
  Element extensionsElement = callActivityElement.element("extensionElements");

  if (extensionsElement != null) {
    // output data elements
    for (Element outElement : extensionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "out")) {

      CallableElementParameter parameter = parseCallableElementProvider(outElement);

      if (attributeValueEquals(outElement, "local", TRUE)) {
        callableElement.addOutputLocal(parameter);
      }
      else {
        callableElement.addOutput(parameter);
      }

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

示例7: parseExecutionListenersOnScope

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses all execution-listeners on a scope.
 *
 * @param scopeElement
 *          the XML element containing the scope definition.
 * @param scope
 *          the scope to add the executionListeners to.
 */
public void parseExecutionListenersOnScope(Element scopeElement, ScopeImpl scope) {
  Element extentionsElement = scopeElement.element("extensionElements");
  if (extentionsElement != null) {
    List<Element> listenerElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "executionListener");
    for (Element listenerElement : listenerElements) {
      String eventName = listenerElement.attribute("event");
      if (isValidEventNameForScope(eventName, listenerElement)) {
        ExecutionListener listener = parseExecutionListener(listenerElement);
        if (listener != null) {
          scope.addExecutionListener(eventName, listener);
        }
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:BpmnParse.java

示例8: parseBPMNPlane

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public void parseBPMNPlane(Element bpmnPlaneElement) {
  String bpmnElement = bpmnPlaneElement.attribute("bpmnElement");
  if (bpmnElement != null && !"".equals(bpmnElement)) {
    // there seems to be only on process without collaboration
    if (getProcessDefinition(bpmnElement) != null) {
      getProcessDefinition(bpmnElement).setGraphicalNotationDefined(true);
    }

    List<Element> shapes = bpmnPlaneElement.elementsNS(BPMN_DI_NS, "BPMNShape");
    for (Element shape : shapes) {
      parseBPMNShape(shape);
    }

    List<Element> edges = bpmnPlaneElement.elementsNS(BPMN_DI_NS, "BPMNEdge");
    for (Element edge : edges) {
      parseBPMNEdge(edge);
    }

  } else {
    addError("'bpmnElement' attribute is required on BPMNPlane ", bpmnPlaneElement);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:BpmnParse.java

示例9: parseFormFields

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseFormFields(Element formData, BpmnParse bpmnParse, ExpressionManager expressionManager) {
  // parse fields:
  List<Element> formFields = formData.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, FORM_FIELD_ELEMENT);
  for (Element formField : formFields) {
    parseFormField(formField, bpmnParse, expressionManager);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:DefaultFormHandler.java

示例10: parseFormPropertyType

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public AbstractFormFieldType parseFormPropertyType(Element formFieldElement, BpmnParse bpmnParse) {
  AbstractFormFieldType formType = null;

  String typeText = formFieldElement.attribute("type");
  String datePatternText = formFieldElement.attribute("datePattern");

  if (typeText == null && DefaultFormHandler.FORM_FIELD_ELEMENT.equals(formFieldElement.getTagName())) {
    bpmnParse.addError("form field must have a 'type' attribute", formFieldElement);
  }

  if ("date".equals(typeText) && datePatternText!=null) {
    formType = new DateFormType(datePatternText);

  } else if ("enum".equals(typeText)) {
    // ACT-1023: Using linked hashmap to preserve the order in which the entries are defined
    Map<String, String> values = new LinkedHashMap<String, String>();
    for (Element valueElement: formFieldElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS,"value")) {
      String valueId = valueElement.attribute("id");
      String valueName = valueElement.attribute("name");
      values.put(valueId, valueName);
    }
    formType = new EnumFormType(values);

  } else if (typeText!=null) {
    formType = formTypes.get(typeText);
    if (formType==null) {
      bpmnParse.addError("unknown type '"+typeText+"'", formFieldElement);
    }
  }
  return formType;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:32,代码来源:FormTypes.java

示例11: parseStartAuthorization

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseStartAuthorization(Element scopeElement, ProcessDefinition definition) {
  ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) definition;

  // parse activiti:potentialStarters
  Element extentionsElement = scopeElement.element("extensionElements");
  if (extentionsElement != null) {
    List<Element> potentialStarterElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, POTENTIAL_STARTER);

    for (Element potentialStarterElement : potentialStarterElements) {
      parsePotentialStarterResourceAssignment(potentialStarterElement, processDefinition);
    }
  }

  // parse activiti:candidateStarterUsers
  String candidateUsersString = scopeElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, CANDIDATE_STARTER_USERS_EXTENSION);
  if (candidateUsersString != null) {
    List<String> candidateUsers = parseCommaSeparatedList(candidateUsersString);
    for (String candidateUser : candidateUsers) {
      processDefinition.addCandidateStarterUserIdExpression(expressionManager.createExpression(candidateUser.trim()));
    }
  }

  // Candidate activiti:candidateStarterGroups
  String candidateGroupsString = scopeElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, CANDIDATE_STARTER_GROUPS_EXTENSION);
  if (candidateGroupsString != null) {
    List<String> candidateGroups = parseCommaSeparatedList(candidateGroupsString);
    for (String candidateGroup : candidateGroups) {
      processDefinition.addCandidateStarterGroupIdExpression(expressionManager.createExpression(candidateGroup.trim()));
    }
  }

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

示例12: parseExecutionListenersOnTransition

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public void parseExecutionListenersOnTransition(Element activitiElement, TransitionImpl activity) {
  Element extensionElements = activitiElement.element("extensionElements");
  if (extensionElements != null) {
    List<Element> listenerElements = extensionElements.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "executionListener");
    for (Element listenerElement : listenerElements) {
      ExecutionListener listener = parseExecutionListener(listenerElement);
      if (listener != null) {
        // Since a transition only fires event 'take', we don't parse the
        // event attribute, it is ignored
        activity.addExecutionListener(listener);
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:BpmnParse.java

示例13: parseBPMNEdge

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public void parseBPMNEdge(Element bpmnEdgeElement) {
  String sequenceFlowId = bpmnEdgeElement.attribute("bpmnElement");
  if (sequenceFlowId != null && !"".equals(sequenceFlowId)) {
    if (sequenceFlows != null && sequenceFlows.containsKey(sequenceFlowId)) {

      TransitionImpl sequenceFlow = sequenceFlows.get(sequenceFlowId);
      List<Element> waypointElements = bpmnEdgeElement.elementsNS(OMG_DI_NS, "waypoint");
      if (waypointElements.size() >= 2) {
        List<Integer> waypoints = new ArrayList<Integer>();
        for (Element waypointElement : waypointElements) {
          waypoints.add(parseDoubleAttribute(waypointElement, "x", waypointElement.attribute("x"), true).intValue());
          waypoints.add(parseDoubleAttribute(waypointElement, "y", waypointElement.attribute("y"), true).intValue());
        }
        sequenceFlow.setWaypoints(waypoints);
      } else {
        addError("Minimum 2 waypoint elements must be definted for a 'BPMNEdge'", bpmnEdgeElement);
      }
    } else if (!elementIds.contains(sequenceFlowId)) { // it might not be a
                                                       // sequenceFlow but it
                                                       // might still
                                                       // reference
                                                       // 'something'
      addError("Invalid reference in 'bpmnElement' attribute, sequenceFlow " + sequenceFlowId + "not found", bpmnEdgeElement);
    }
  } else {
    addError("'bpmnElement' attribute is required on BPMNEdge", bpmnEdgeElement);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:29,代码来源:BpmnParse.java

示例14: parseFormProperties

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseFormProperties(BpmnParse bpmnParse, ExpressionManager expressionManager, Element extensionElement) {
  FormTypes formTypes = getFormTypes();

  List<Element> formPropertyElements = extensionElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, FORM_PROPERTY_ELEMENT);
  for (Element formPropertyElement : formPropertyElements) {
    FormPropertyHandler formPropertyHandler = new FormPropertyHandler();

    String id = formPropertyElement.attribute("id");
    if (id==null) {
      bpmnParse.addError("attribute 'id' is required", formPropertyElement);
    }
    formPropertyHandler.setId(id);

    String name = formPropertyElement.attribute("name");
    formPropertyHandler.setName(name);

    AbstractFormFieldType type = formTypes.parseFormPropertyType(formPropertyElement, bpmnParse);
    formPropertyHandler.setType(type);

    String requiredText = formPropertyElement.attribute("required", "false");
    Boolean required = bpmnParse.parseBooleanAttribute(requiredText);
    if (required!=null) {
      formPropertyHandler.setRequired(required);
    } else {
      bpmnParse.addError("attribute 'required' must be one of {on|yes|true|enabled|active|off|no|false|disabled|inactive}", formPropertyElement);
    }

    String readableText = formPropertyElement.attribute("readable", "true");
    Boolean readable = bpmnParse.parseBooleanAttribute(readableText);
    if (readable!=null) {
      formPropertyHandler.setReadable(readable);
    } else {
      bpmnParse.addError("attribute 'readable' must be one of {on|yes|true|enabled|active|off|no|false|disabled|inactive}", formPropertyElement);
    }

    String writableText = formPropertyElement.attribute("writable", "true");
    Boolean writable = bpmnParse.parseBooleanAttribute(writableText);
    if (writable!=null) {
      formPropertyHandler.setWritable(writable);
    } else {
      bpmnParse.addError("attribute 'writable' must be one of {on|yes|true|enabled|active|off|no|false|disabled|inactive}", formPropertyElement);
    }

    String variableName = formPropertyElement.attribute("variable");
    formPropertyHandler.setVariableName(variableName);

    String expressionText = formPropertyElement.attribute("expression");
    if (expressionText!=null) {
      Expression expression = expressionManager.createExpression(expressionText);
      formPropertyHandler.setVariableExpression(expression);
    }

    String defaultExpressionText = formPropertyElement.attribute("default");
    if (defaultExpressionText!=null) {
      Expression defaultExpression = expressionManager.createExpression(defaultExpressionText);
      formPropertyHandler.setDefaultExpression(defaultExpression);
    }

    formPropertyHandlers.add(formPropertyHandler);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:62,代码来源:DefaultFormHandler.java

示例15: parseCamundaInputParameters

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses all input parameters of an input output element and adds them to
 * the {@link IoMapping}.
 *
 * @param inputOutputElement the input output element to process
 * @param ioMapping the input output mapping to add input parameters to
 * @throws BpmnParseException if a input parameter element is malformed
 */
public static void parseCamundaInputParameters(Element inputOutputElement, IoMapping ioMapping) {
  List<Element> inputParameters = inputOutputElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputParameter");
  for (Element inputParameterElement : inputParameters) {
    parseInputParameterElement(inputParameterElement, ioMapping);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:BpmnParseUtil.java


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