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


Java Element.getText方法代码示例

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


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

示例1: parseCamundaScript

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Parses a camunda script element.
 *
 * @param scriptElement the script element ot parse
 * @return the generated executable script
 * @throws BpmnParseException if the a attribute is missing or the script cannot be processed
 */
public static ExecutableScript parseCamundaScript(Element scriptElement) {
  String scriptLanguage = scriptElement.attribute("scriptFormat");
  if (scriptLanguage == null || scriptLanguage.isEmpty()) {
    throw new BpmnParseException("Missing attribute 'scriptFormatAttribute' for 'script' element", scriptElement);
  }
  else {
    String scriptResource = scriptElement.attribute("resource");
    String scriptSource = scriptElement.getText();
    try {
      return ScriptUtil.getScript(scriptLanguage, scriptSource, scriptResource, getExpressionManager());
    }
    catch (ProcessEngineException e) {
      throw new BpmnParseException("Unable to process script", scriptElement, e);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:BpmnParseUtil.java

示例2: 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

示例3: parseScriptTaskElement

import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
 * Returns a {@link ScriptTaskActivityBehavior} for the script task element
 * corresponding to the script source or resource specified.
 *
 * @param scriptTaskElement
 *          the script task element
 * @return the corresponding {@link ScriptTaskActivityBehavior}
 */
protected ScriptTaskActivityBehavior parseScriptTaskElement(Element scriptTaskElement) {
  // determine script language
  String language = scriptTaskElement.attribute("scriptFormat");
  if (language == null) {
    language = ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE;
  }
  String resultVariableName = parseResultVariable(scriptTaskElement);

  // determine script source
  String scriptSource = null;
  Element scriptElement = scriptTaskElement.element("script");
  if (scriptElement != null) {
    scriptSource = scriptElement.getText();
  }
  String scriptResource = scriptTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_RESOURCE);

  try {
    ExecutableScript script = ScriptUtil.getScript(language, scriptSource, scriptResource, expressionManager);
    return new ScriptTaskActivityBehavior(script, resultVariableName);
  } catch (ProcessEngineException e) {
    addError("Unable to process ScriptTask: " + e.getMessage(), scriptElement);
    return null;
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:33,代码来源:BpmnParse.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


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