• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BpmnParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.activiti.engine.impl.bpmn.parser.BpmnParser的典型用法代码示例。如果您正苦于以下问题:Java BpmnParser类的具体用法?Java BpmnParser怎么用?Java BpmnParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BpmnParser类属于org.activiti.engine.impl.bpmn.parser包,在下文中一共展示了BpmnParser类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadXmlTest

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
@Test
public void loadXmlTest() throws Exception {

	ProcessEngineConfigurationImpl configuration = (ProcessEngineConfigurationImpl) processEngine
			.getProcessEngineConfiguration();
	Context.setProcessEngineConfiguration(configuration);

	InputStream inputStream = ReflectUtil.getResourceAsStream("extProperty.bpmn");

	BpmnParser bpmnParser = configuration.getBpmnParser();
	BpmnParse bpmnParse = new BpmnParse(bpmnParser).sourceInputStream(inputStream).setSourceSystemId("extProperty")
			.name("extProperty");

	bpmnParse.execute();

	ActivityImpl approveTask = bpmnParse.getCurrentScope().findActivity("approveTask");
	Map<String, Object> properties = approveTask.getProperties();

	for (String key : properties.keySet()) {
		System.out.println(properties.get(key));
	}

}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:24,代码来源:ExtPropertyTest.java


示例2: getElementBoundsFromBpmnDi

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
protected Map<String, DiagramNode> getElementBoundsFromBpmnDi(Document bpmnModel) {
    Map<String, DiagramNode> listOfBounds = new HashMap<>();
    // iterate over all DI shapes
    NodeList shapes = bpmnModel.getElementsByTagNameNS(BpmnParser.BPMN_DI_NS, "BPMNShape");
    for (int i = 0; i < shapes.getLength(); i++) {
        Element shape = (Element) shapes.item(i);
        String bpmnElementId = shape.getAttribute("bpmnElement");
        // get bounds of shape
        NodeList childNodes = shape.getChildNodes();
        for (int j = 0; j < childNodes.getLength(); j++) {
            Node childNode = childNodes.item(j);
            if (childNode instanceof Element
                    && BpmnParser.BPMN_DC_NS.equals(childNode.getNamespaceURI())
                    && "Bounds".equals(childNode.getLocalName())) {
                DiagramNode bounds = parseBounds((Element) childNode);
                bounds.setId(bpmnElementId);
                listOfBounds.put(bpmnElementId, bounds);
                break;
            }
        }
    }
    return listOfBounds;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:ProcessDiagramLayoutFactory.java


示例3: getDefaultDeployers

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
protected Collection< ? extends Deployer> getDefaultDeployers() {
  List<Deployer> defaultDeployers = new ArrayList<Deployer>();

  BpmnDeployer bpmnDeployer = new BpmnDeployer();
  bpmnDeployer.setExpressionManager(expressionManager);
  bpmnDeployer.setIdGenerator(idGenerator);
  BpmnParser bpmnParser = new BpmnParser(expressionManager);
  
  if(preParseListeners != null) {
    bpmnParser.getParseListeners().addAll(preParseListeners);
  }
  bpmnParser.getParseListeners().addAll(getDefaultBPMNParseListeners());
  if(postParseListeners != null) {
    bpmnParser.getParseListeners().addAll(postParseListeners);
  }
  
  bpmnDeployer.setBpmnParser(bpmnParser);
  
  defaultDeployers.add(bpmnDeployer);
  return defaultDeployers;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:ProcessEngineConfigurationImpl.java


示例4: parseFormPropertyType

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public AbstractFormType parseFormPropertyType(Element formPropertyElement, BpmnParse bpmnParse) {
  AbstractFormType formType = null;

  String typeText = formPropertyElement.attribute("type");
  String datePatternText = formPropertyElement.attribute("datePattern");
  
  if ("date".equals(typeText) && datePatternText!=null) {
    formType = new DateFormType(datePatternText);
    
  } else if ("enum".equals(typeText)) {
    Map<String, String> values = new HashMap<String, String>();
    for (Element valueElement: formPropertyElement.elementsNS(BpmnParser.ACTIVITI_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+"'", formPropertyElement);
    }
  }
  return formType;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:FormTypes.java


示例5: getElementBoundsFromBpmnDi

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
protected Map<String, DiagramNode> getElementBoundsFromBpmnDi(Document bpmnModel) {
  Map<String, DiagramNode> listOfBounds = new HashMap<String, DiagramNode>();
  // iterate over all DI shapes
  NodeList shapes = bpmnModel.getElementsByTagNameNS(BpmnParser.BPMN_DI_NS, "BPMNShape");
  for (int i = 0; i < shapes.getLength(); i++) {
    Element shape = (Element) shapes.item(i);
    String bpmnElementId = shape.getAttribute("bpmnElement");
    // get bounds of shape
    NodeList childNodes = shape.getChildNodes();
    for (int j = 0; j < childNodes.getLength(); j++) {
      Node childNode = childNodes.item(j);
      if (childNode instanceof Element
              && BpmnParser.BPMN_DC_NS.equals(childNode.getNamespaceURI())
              && "Bounds".equals(childNode.getLocalName())) {
        DiagramNode bounds = parseBounds((Element) childNode);
        bounds.setId(bpmnElementId);
        listOfBounds.put(bpmnElementId, bounds);
        break;
      }
    }
  }
  return listOfBounds;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:24,代码来源:ProcessDiagramLayoutFactory.java


示例6: getBpmnParser

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public BpmnParser getBpmnParser() {
    return bpmnParser;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java


示例7: setBpmnParser

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public ProcessEngineConfigurationImpl setBpmnParser(BpmnParser bpmnParser) {
    this.bpmnParser = bpmnParser;
    return this;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:ProcessEngineConfigurationImpl.java


示例8: createBpmnParse

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
@Override
public BpmnParse createBpmnParse(BpmnParser bpmnParser) {
    return new BpmnParse(bpmnParser);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:DefaultBpmnParseFactory.java


示例9: setBpmnParser

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public void setBpmnParser(BpmnParser bpmnParser) {
    this.bpmnParser = bpmnParser;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:4,代码来源:BpmnDeployer.java


示例10: parseConfiguration

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse) {
  this.deploymentId = deployment.getId();
  this.formKey = activityElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "formKey");
  Element extensionElement = activityElement.element("extensionElements");
  if (extensionElement != null) {

    ExpressionManager expressionManager = Context
      .getProcessEngineConfiguration()
      .getExpressionManager();
    
    FormTypes formTypes = Context
      .getProcessEngineConfiguration()
      .getFormTypes();
  
    List<Element> formPropertyElements = extensionElement.elementsNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "formProperty");
    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);
      
      AbstractFormType 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);
      }

      formPropertyHandlers.add(formPropertyHandler);
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:68,代码来源:DefaultFormHandler.java


示例11: getBpmnParser

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public BpmnParser getBpmnParser() {
  return bpmnParser;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:BpmnDeployer.java


示例12: setBpmnParser

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public void setBpmnParser(BpmnParser bpmnParser) {
  this.bpmnParser = bpmnParser;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:BpmnDeployer.java


示例13: parseConfiguration

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse) {
  this.deploymentId = deployment.getId();
  this.formKey = activityElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "formKey");
  Element extensionElement = activityElement.element("extensionElements");
  if (extensionElement != null) {

    ExpressionManager expressionManager = Context
      .getProcessEngineConfiguration()
      .getExpressionManager();
    
    FormTypes formTypes = Context
      .getProcessEngineConfiguration()
      .getFormTypes();
  
    List<Element> formPropertyElements = extensionElement.elementsNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "formProperty");
    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);
      
      AbstractFormType 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:iotsap,项目名称:FiWare-Template-Handler,代码行数:74,代码来源:DefaultFormHandler.java


示例14: setBpmnParser

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public ProcessEngineConfigurationImpl setBpmnParser(BpmnParser bpmnParser) {
  this.bpmnParser = bpmnParser;
  return this;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:5,代码来源:ProcessEngineConfigurationImpl.java


示例15: createBpmnParse

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
public BpmnParse createBpmnParse(BpmnParser bpmnParser) {
  return new BpmnParse(bpmnParser);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:4,代码来源:DefaultBpmnParseFactory.java


示例16: createBpmnParse

import org.activiti.engine.impl.bpmn.parser.BpmnParser; //导入依赖的package包/类
BpmnParse createBpmnParse(BpmnParser bpmnParser); 
开发者ID:flowable,项目名称:flowable-engine,代码行数:2,代码来源:BpmnParseFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClassResolvers类代码示例发布时间:2022-05-23
下一篇:
Java StateInitializationContext类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap