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


Java Element.elements方法代码示例

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


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

示例1: parseCollaboration

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses the collaboration definition defined within the 'definitions' root
 * element and get all participants to lookup their process references during
 * DI parsing.
 */
public void parseCollaboration() {
  Element collaboration = rootElement.element("collaboration");
  if (collaboration != null) {
    for (Element participant : collaboration.elements("participant")) {
      String processRef = participant.attribute("processRef");
      if (processRef != null) {
        ProcessDefinitionImpl procDef = getProcessDefinition(processRef);
        if (procDef != null) {
          // Set participant process on the procDef, so it can get rendered
          // later on if needed
          ParticipantProcess participantProcess = new ParticipantProcess();
          participantProcess.setId(participant.attribute("id"));
          participantProcess.setName(participant.attribute("name"));
          procDef.setParticipantProcess(participantProcess);

          participantProcesses.put(participantProcess.getId(), processRef);
        }
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:BpmnParse.java

示例2: parseLaneSets

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseLaneSets(Element parentElement, ProcessDefinitionEntity processDefinition) {
  List<Element> laneSets = parentElement.elements("laneSet");

  if (laneSets != null && laneSets.size() > 0) {
    for (Element laneSetElement : laneSets) {
      LaneSet newLaneSet = new LaneSet();

      newLaneSet.setId(laneSetElement.attribute("id"));
      newLaneSet.setName(laneSetElement.attribute("name"));
      parseLanes(laneSetElement, newLaneSet);

      // Finally, add the set
      processDefinition.addLaneSet(newLaneSet);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:BpmnParse.java

示例3: parseLanes

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseLanes(Element laneSetElement, LaneSet laneSet) {
  List<Element> lanes = laneSetElement.elements("lane");
  if (lanes != null && lanes.size() > 0) {
    for (Element laneElement : lanes) {
      // Parse basic attributes
      Lane lane = new Lane();
      lane.setId(laneElement.attribute("id"));
      lane.setName(laneElement.attribute("name"));

      // Parse ID's of flow-nodes that live inside this lane
      List<Element> flowNodeElements = laneElement.elements("flowNodeRef");
      if (flowNodeElements != null && flowNodeElements.size() > 0) {
        for (Element flowNodeElement : flowNodeElements) {
          lane.getFlowNodeIds().add(flowNodeElement.getText());
        }
      }

      laneSet.addLane(lane);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:BpmnParse.java

示例4: parseJobAcquisition

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * parse a <code>&lt;job-acquisition .../&gt;</code> element and add it to the
 * list of parsed elements
 */
protected void parseJobAcquisition(Element element, List<JobAcquisitionXml> jobAcquisitions) {

  JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl();

  // set name
  jobAcquisition.setName(element.attribute(NAME));

  Map<String, String> properties = new HashMap<String, String>();

  for (Element childElement : element.elements()) {
    if (JOB_EXECUTOR_CLASS_NAME.equals(childElement.getTagName())) {
      jobAcquisition.setJobExecutorClassName(childElement.getText());

    } else if (PROPERTIES.equals(childElement.getTagName())) {
      parseProperties(childElement, properties);

    }
  }

  // set collected properties
  jobAcquisition.setProperties(properties);
  // add to list
  jobAcquisitions.add(jobAcquisition);

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

示例5: parseScope

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses a scope: a process, subprocess, etc.
 *
 * Note that a process definition is a scope on itself.
 *
 * @param scopeElement
 *          The XML element defining the scope
 * @param parentScope
 *          The scope that contains the nested scope.
 */
public void parseScope(Element scopeElement, ScopeImpl parentScope) {

  // Not yet supported on process level (PVM additions needed):
  // parseProperties(processElement);

  // filter activities that must be parsed separately
  List<Element> activityElements = new ArrayList<Element>(scopeElement.elements());
  Map<String, Element> intermediateCatchEvents = filterIntermediateCatchEvents(activityElements);
  activityElements.removeAll(intermediateCatchEvents.values());
  Map<String, Element> compensationHandlers = filterCompensationHandlers(activityElements);
  activityElements.removeAll(compensationHandlers.values());

  parseStartEvents(scopeElement, parentScope);
  parseActivities(activityElements, scopeElement, parentScope);
  parseIntermediateCatchEvents(scopeElement, parentScope, intermediateCatchEvents);
  parseEndEvents(scopeElement, parentScope);
  parseBoundaryEvents(scopeElement, parentScope);
  parseSequenceFlow(scopeElement, parentScope, compensationHandlers);
  parseExecutionListenersOnScope(scopeElement, parentScope);
  parseAssociations(scopeElement, parentScope, compensationHandlers);
  parseCompensationHandlers(parentScope, compensationHandlers);

  for (ScopeImpl.BacklogErrorCallback callback : parentScope.getBacklogErrorCallbacks()) {
    callback.callback();
  }

  if (parentScope instanceof ProcessDefinition) {
    parseProcessDefinitionCustomExtensions(scopeElement, (ProcessDefinition) parentScope);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:41,代码来源:BpmnParse.java

示例6: parseAssociations

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseAssociations(Element scopeElement, ScopeImpl parentScope, Map<String, Element> compensationHandlers) {
  for (Element associationElement : scopeElement.elements("association")) {
    String sourceRef = associationElement.attribute("sourceRef");
    if (sourceRef == null) {
      addError("association element missing attribute 'sourceRef'", associationElement);
    }
    String targetRef = associationElement.attribute("targetRef");
    if (targetRef == null) {
      addError("association element missing attribute 'targetRef'", associationElement);
    }
    ActivityImpl sourceActivity = parentScope.findActivity(sourceRef);
    ActivityImpl targetActivity = parentScope.findActivity(targetRef);

    // an association may reference elements that are not parsed as activities
    // (like for instance text annotations so do not throw an exception if sourceActivity or targetActivity are null)
    // However, we make sure they reference 'something':
    if (sourceActivity == null && !elementIds.contains(sourceRef)) {
      addError("Invalid reference sourceRef '" + sourceRef + "' of association element ", associationElement);
    } else if (targetActivity == null && !elementIds.contains(targetRef)) {
      addError("Invalid reference targetRef '" + targetRef + "' of association element ", associationElement);
    } else {

      if (sourceActivity != null && ActivityTypes.BOUNDARY_COMPENSATION.equals(sourceActivity.getProperty(BpmnProperties.TYPE.getName()))) {

        if (targetActivity == null && compensationHandlers.containsKey(targetRef)) {
          targetActivity = parseCompensationHandlerForCompensationBoundaryEvent(parentScope, sourceActivity, targetRef, compensationHandlers);

          compensationHandlers.remove(targetActivity.getId());
        }

        if (targetActivity != null) {
          parseAssociationOfCompensationBoundaryEvent(associationElement, sourceActivity, targetActivity);
        }
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:38,代码来源:BpmnParse.java

示例7: parseStartEvents

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses the start events of a certain level in the process (process,
 * subprocess or another scope).
 *
 * @param parentElement
 *          The 'parent' element that contains the start events (process,
 *          subprocess).
 * @param scope
 *          The {@link ScopeImpl} to which the start events must be added.
 */
public void parseStartEvents(Element parentElement, ScopeImpl scope) {
  List<Element> startEventElements = parentElement.elements("startEvent");
  List<ActivityImpl> startEventActivities = new ArrayList<ActivityImpl>();
  for (Element startEventElement : startEventElements) {

    ActivityImpl startEventActivity = createActivityOnScope(startEventElement, scope);
    parseAsynchronousContinuationForActivity(startEventElement, startEventActivity);

    if (scope instanceof ProcessDefinitionEntity) {
      parseProcessDefinitionStartEvent(startEventActivity, startEventElement, parentElement, scope);
      startEventActivities.add(startEventActivity);
    } else {
      parseScopeStartEvent(startEventActivity, startEventElement, parentElement, (ActivityImpl) scope);
    }

    ensureNoIoMappingDefined(startEventElement);

    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseStartEvent(startEventElement, scope, startEventActivity);
    }
    parseExecutionListenersOnScope(startEventElement, startEventActivity);
  }

  if (scope instanceof ProcessDefinitionEntity) {
    selectInitial(startEventActivities, (ProcessDefinitionEntity) scope, parentElement);
    parseStartFormHandlers(startEventElements, (ProcessDefinitionEntity) scope);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:39,代码来源:BpmnParse.java

示例8: parseDocumentation

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public String parseDocumentation(Element element) {
  List<Element> docElements = element.elements("documentation");
  List<String> docStrings = new ArrayList<String>();
  for (Element e : docElements) {
    docStrings.add(e.getText());
  }

  return parseDocumentation(docStrings);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:BpmnParse.java

示例9: parseHumanPerformer

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseHumanPerformer(Element taskElement, TaskDefinition taskDefinition) {
  List<Element> humanPerformerElements = taskElement.elements(HUMAN_PERFORMER);

  if (humanPerformerElements.size() > 1) {
    addError("Invalid task definition: multiple " + HUMAN_PERFORMER + " sub elements defined for " + taskDefinition.getNameExpression(), taskElement);
  } else if (humanPerformerElements.size() == 1) {
    Element humanPerformerElement = humanPerformerElements.get(0);
    if (humanPerformerElement != null) {
      parseHumanPerformerResourceAssignment(humanPerformerElement, taskDefinition);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:BpmnParse.java

示例10: parseProcessEnginePlugins

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Transform a <code>&lt;plugins ... /&gt;</code> structure.
 */
protected void parseProcessEnginePlugins(Element element, List<ProcessEnginePluginXml> plugins) {
  for (Element chidElement : element.elements()) {
    if(PLUGIN.equals(chidElement.getTagName())) {
      parseProcessEnginePlugin(chidElement, plugins);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:DeploymentMetadataParse.java

示例11: parseParamValueProvider

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * @throws BpmnParseException if the parameter is invalid
 */
protected static ParameterValueProvider parseParamValueProvider(Element parameterElement) {

  // LIST
  if("list".equals(parameterElement.getTagName())) {
    List<ParameterValueProvider> providerList = new ArrayList<ParameterValueProvider>();
    for (Element element : parameterElement.elements()) {
      // parse nested provider
      providerList.add(parseParamValueProvider(element));
    }
    return new ListValueProvider(providerList);
  }

  // MAP
  if("map".equals(parameterElement.getTagName())) {
    TreeMap<ParameterValueProvider, ParameterValueProvider> providerMap = new TreeMap<ParameterValueProvider, ParameterValueProvider>();
    for (Element entryElement : parameterElement.elements("entry")) {
      // entry must provide key
      String keyAttribute = entryElement.attribute("key");
      if(keyAttribute == null || keyAttribute.isEmpty()) {
        throw new BpmnParseException("Missing attribute 'key' for 'entry' element", entryElement);
      }
      // parse nested provider
      providerMap.put(new ElValueProvider(getExpressionManager().createExpression(keyAttribute)), parseNestedParamValueProvider(entryElement));
    }
    return new MapValueProvider(providerMap);
  }

  // SCRIPT
  if("script".equals(parameterElement.getTagName())) {
    ExecutableScript executableScript = parseCamundaScript(parameterElement);
    if (executableScript != null) {
      return new ScriptValueProvider(executableScript);
    }
    else {
      return new NullValueProvider();
    }
  }

  String textContent = parameterElement.getText().trim();
  if(!textContent.isEmpty()) {
      // EL
      return new ElValueProvider(getExpressionManager().createExpression(textContent));
  } else {
    // NULL value
    return new NullValueProvider();
  }

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

示例12: parsePotentialOwner

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parsePotentialOwner(Element taskElement, TaskDefinition taskDefinition) {
  List<Element> potentialOwnerElements = taskElement.elements(POTENTIAL_OWNER);
  for (Element potentialOwnerElement : potentialOwnerElements) {
    parsePotentialOwnerResourceAssignment(potentialOwnerElement, taskDefinition);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:7,代码来源:BpmnParse.java

示例13: parseProcessEngine

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * parse a <code>&lt;process-engine .../&gt;</code> element and add it to the list of parsed elements
 */
protected void parseProcessEngine(Element element, List<ProcessEngineXml> parsedProcessEngines) {

  ProcessEngineXmlImpl processEngine = new ProcessEngineXmlImpl();

  // set name
  processEngine.setName(element.attribute(NAME));

  // set default
  String defaultValue = element.attribute(DEFAULT);
  if(defaultValue == null || defaultValue.isEmpty()) {
    processEngine.setDefault(false);
  } else {
    processEngine.setDefault(Boolean.parseBoolean(defaultValue));
  }

  Map<String, String> properties = new HashMap<String, String>();
  List<ProcessEnginePluginXml> plugins = new ArrayList<ProcessEnginePluginXml>();

  for (Element childElement : element.elements()) {
    if(CONFIGURATION.equals(childElement.getTagName())) {
      processEngine.setConfigurationClass(childElement.getText());

    } else if(DATASOURCE.equals(childElement.getTagName())) {
      processEngine.setDatasource(childElement.getText());

    } else if(JOB_ACQUISITION.equals(childElement.getTagName())) {
      processEngine.setJobAcquisitionName(childElement.getText());

    } else if(PROPERTIES.equals(childElement.getTagName())) {
      parseProperties(childElement, properties);

    } else if(PLUGINS.equals(childElement.getTagName())) {
      parseProcessEnginePlugins(childElement, plugins);

    }
  }

  // set collected properties
  processEngine.setProperties(properties);
  // set plugins
  processEngine.setPlugins(plugins);
  // add the process engine to the list of parsed engines.
  parsedProcessEngines.add(processEngine);

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

示例14: parseProcessEnginePlugin

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Transform a <code>&lt;plugin ... /&gt;</code> structure.
 */
protected void parseProcessEnginePlugin(Element element, List<ProcessEnginePluginXml> plugins) {

  ProcessEnginePluginXmlImpl plugin = new ProcessEnginePluginXmlImpl();

  Map<String, String> properties = new HashMap<String, String>();

  for (Element childElement : element.elements()) {
    if(PLUGIN_CLASS.equals(childElement.getTagName())) {
      plugin.setPluginClass(childElement.getText());

    } else if(PROPERTIES.equals(childElement.getTagName())) {
      parseProperties(childElement, properties);

    }

  }

  plugin.setProperties(properties);
  plugins.add(plugin);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:DeploymentMetadataParse.java

示例15: parseJobExecutor

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * parse a <code>&lt;job-executor .../&gt;</code> element and add it to the list of parsed elements
 */
protected void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml) {

  List<JobAcquisitionXml> jobAcquisitions = new ArrayList<JobAcquisitionXml>();
  Map<String, String> properties = new HashMap<String, String>();

  for (Element childElement : element.elements()) {

    if(JOB_ACQUISITION.equals(childElement.getTagName())) {
      parseJobAcquisition(childElement, jobAcquisitions);

    }else if(PROPERTIES.equals(childElement.getTagName())){
      parseProperties(childElement, properties);
    }

  }

  jobExecutorXml.setJobAcquisitions(jobAcquisitions);
  jobExecutorXml.setProperties(properties);

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


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