org.jbpm.workflow.core.impl.WorkflowProcessImpl类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.jbpm.workflow.core.impl.WorkflowProcessImpl类的一些代码示例,展示了WorkflowProcessImpl类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowProcessImpl类的具体详情如下:
包路径:org.jbpm.workflow.core.impl.WorkflowProcessImpl
类名称:WorkflowProcessImpl

WorkflowProcessImpl介绍

[英]Default implementation of a RuleFlow process.
[中]规则流流程的默认实现。

代码示例

代码示例来源:origin: kiegroup/jbpm

  1. public Object start(final String uri, final String localName,
  2. final Attributes attrs, final ExtensibleXmlParser parser)
  3. throws SAXException {
  4. parser.startElementBuilder(localName, attrs);
  5. WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
  6. final String name = attrs.getValue("name");
  7. final String type = attrs.getValue("importType");
  8. final String location = attrs.getValue("location");
  9. final String namespace = attrs.getValue("namespace");
  10. emptyAttributeCheck(localName, "name", name, parser);
  11. if (type != null && location != null && namespace != null) {
  12. Map<String, String> typedImports = (Map<String, String>) process.getMetaData(type);
  13. if (typedImports == null) {
  14. typedImports = new HashMap<String, String>();
  15. process.setMetaData(type, typedImports);
  16. }
  17. typedImports.put(namespace, location);
  18. } else {
  19. java.util.Set<String> list = process.getImports();
  20. if (list == null) {
  21. list = new HashSet<String>();
  22. process.setImports(list);
  23. }
  24. list.add(name);
  25. }
  26. return null;
  27. }

代码示例来源:origin: kiegroup/jbpm

  1. private String generateRules(final Process process) {
  2. StringBuffer builder = new StringBuffer();
  3. if ( process instanceof WorkflowProcessImpl ) {
  4. WorkflowProcessImpl ruleFlow = (WorkflowProcessImpl) process;
  5. builder.append( "package " + ruleFlow.getPackageName() + "\n" );
  6. Set<String> imports = ruleFlow.getImports();
  7. if ( imports != null ) {
  8. for ( String importString: imports ) {
  9. builder.append( "import " + importString + ";\n" );
  10. }
  11. }
  12. List<String> functionImports = ruleFlow.getFunctionImports();
  13. if ( functionImports != null ) {
  14. for ( String importString: functionImports ) {
  15. builder.append( "import function " + importString + ";\n" );
  16. }
  17. }
  18. Map<String, String> globals = ruleFlow.getGlobals();
  19. if ( globals != null ) {
  20. for ( Map.Entry<String, String> entry: globals.entrySet()) {
  21. builder.append( "global " + entry.getValue() + " " + entry.getKey() + ";\n" );
  22. }
  23. }
  24. Node[] nodes = ruleFlow.getNodes();
  25. generateRules(nodes, process, builder);
  26. }
  27. return builder.toString();
  28. }

代码示例来源:origin: kiegroup/jbpm

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser parser) throws SAXException {
  5. parser.startElementBuilder( localName, attrs );
  6. WorkflowProcessImpl process = ( WorkflowProcessImpl ) parser.getParent();
  7. final String identifier = attrs.getValue( "identifier" );
  8. final String type = attrs.getValue( "type" );
  9. emptyAttributeCheck( localName, "identifier", identifier, parser );
  10. emptyAttributeCheck( localName, "type", type, parser );
  11. Map<String, String> map = process.getGlobals();
  12. if ( map == null ) {
  13. map = new HashMap<String, String>();
  14. process.setGlobals( map );
  15. }
  16. map.put( identifier, type );
  17. return null;
  18. }

代码示例来源:origin: kiegroup/jbpm

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser parser) throws SAXException {
  5. parser.startElementBuilder( localName,
  6. attrs );
  7. WorkflowProcessImpl process = ( WorkflowProcessImpl ) parser.getParent();
  8. final String name = attrs.getValue( "name" );
  9. emptyAttributeCheck( localName, "name", name, parser );
  10. java.util.Set<String> list = process.getImports();
  11. if ( list == null ) {
  12. list = new HashSet<String>();
  13. process.setImports( list );
  14. }
  15. list.add( name );
  16. return null;
  17. }

代码示例来源:origin: kiegroup/jbpm

  1. processDescr.setName( "Process1" );
  2. WorkflowProcessImpl process = new WorkflowProcessImpl();
  3. process.setName( "Process1" );
  4. process.setPackageName( "pkg1" );

代码示例来源:origin: kiegroup/jbpm

  1. NodeInstanceFactoryRegistry.getInstance(ksession.getEnvironment()).register( mockNode.getClass(), factory );
  2. WorkflowProcessImpl process = new WorkflowProcessImpl();
  3. new ConnectionImpl(mockNode, Node.CONNECTION_DEFAULT_TYPE, endNode, Node.CONNECTION_DEFAULT_TYPE);
  4. process.addNode( mockNode );
  5. process.addNode( endNode );

代码示例来源:origin: org.jbpm/jbpm-workitems-webservice

  1. List<Bpmn2Import> typedImports = (List<Bpmn2Import>) process.getMetaData("Bpmn2Imports");

代码示例来源:origin: kiegroup/jbpm

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser xmlPackageReader) throws SAXException {
  5. xmlPackageReader.startElementBuilder( localName,
  6. attrs );
  7. WorkflowProcessImpl process = ( WorkflowProcessImpl ) xmlPackageReader.getParent();
  8. ActionNode actionNode = new ActionNode();
  9. final String name = attrs.getValue( "name" );
  10. emptyAttributeCheck( localName, "name", name, xmlPackageReader );
  11. actionNode.setName( name );
  12. final String id = attrs.getValue( "id" );
  13. emptyAttributeCheck( localName, "id", name, xmlPackageReader );
  14. actionNode.setId( new Long(id) );
  15. process.addNode( actionNode );
  16. ((ProcessBuildData)xmlPackageReader.getData()).addNode( actionNode );
  17. return actionNode;
  18. }

代码示例来源:origin: kiegroup/jbpm

  1. @Test
  2. public void testAccept() {
  3. KieBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
  4. KieSession ksession = kbase.newKieSession();
  5. WorkflowProcessImpl process = new WorkflowProcessImpl();
  6. RuleFlowProcessInstance processInstance = new RuleFlowProcessInstance();
  7. processInstance.setState(ProcessInstance.STATE_ACTIVE);
  8. processInstance.setProcess(process);
  9. processInstance.setKnowledgeRuntime((InternalKnowledgeRuntime) ksession);
  10. ProcessInstanceResolverStrategy strategy = new ProcessInstanceResolverStrategy();
  11. assertTrue( strategy.accept(processInstance) );
  12. Object object = new Object();
  13. assertTrue( ! strategy.accept(object) );
  14. }

代码示例来源:origin: kiegroup/jbpm

  1. public WorkflowProcessImpl() {
  2. nodeContainer = (org.jbpm.workflow.core.NodeContainer) createNodeContainer();
  3. }

代码示例来源:origin: kiegroup/jbpm

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser parser) throws SAXException {
  5. parser.startElementBuilder( localName,
  6. attrs );
  7. WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
  8. final String name = attrs.getValue("name");
  9. emptyAttributeCheck(localName, "name", name, parser);
  10. SwimlaneContext swimlaneContext = (SwimlaneContext)
  11. process.getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
  12. if (swimlaneContext != null) {
  13. Swimlane swimlane = new Swimlane();
  14. swimlane.setName(name);
  15. swimlaneContext.addSwimlane(swimlane);
  16. } else {
  17. throw new SAXParseException(
  18. "Could not find default swimlane context.", parser.getLocator());
  19. }
  20. return null;
  21. }

代码示例来源:origin: kiegroup/jbpm

  1. processDescr.setName("Process1");
  2. WorkflowProcessImpl process = new WorkflowProcessImpl();
  3. process.setName("Process1");
  4. process.setPackageName("pkg1");

代码示例来源:origin: org.jbpm/jbpm-flow-builder

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser parser) throws SAXException {
  5. parser.startElementBuilder( localName,
  6. attrs );
  7. WorkflowProcessImpl process = ( WorkflowProcessImpl ) parser.getParent();
  8. final String name = attrs.getValue( "name" );
  9. emptyAttributeCheck( localName, "name", name, parser );
  10. java.util.Set<String> list = process.getImports();
  11. if ( list == null ) {
  12. list = new HashSet<String>();
  13. process.setImports( list );
  14. }
  15. list.add( name );
  16. return null;
  17. }

代码示例来源:origin: org.jbpm/jbpm-workitems-bpmn2

  1. List<Bpmn2Import> typedImports = (List<Bpmn2Import>) process.getMetaData("Bpmn2Imports");

代码示例来源:origin: org.jbpm/jbpm-flow

  1. public WorkflowProcessImpl() {
  2. nodeContainer = (org.jbpm.workflow.core.NodeContainer) createNodeContainer();
  3. }

代码示例来源:origin: org.jbpm/jbpm-flow-builder

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser parser) throws SAXException {
  5. parser.startElementBuilder( localName,
  6. attrs );
  7. WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
  8. final String name = attrs.getValue("name");
  9. emptyAttributeCheck(localName, "name", name, parser);
  10. SwimlaneContext swimlaneContext = (SwimlaneContext)
  11. process.getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
  12. if (swimlaneContext != null) {
  13. Swimlane swimlane = new Swimlane();
  14. swimlane.setName(name);
  15. swimlaneContext.addSwimlane(swimlane);
  16. } else {
  17. throw new SAXParseException(
  18. "Could not find default swimlane context.", parser.getLocator());
  19. }
  20. return null;
  21. }

代码示例来源:origin: org.jbpm/jbpm-bpmn2

  1. public Object start(final String uri, final String localName,
  2. final Attributes attrs, final ExtensibleXmlParser parser)
  3. throws SAXException {
  4. parser.startElementBuilder(localName, attrs);
  5. WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
  6. final String name = attrs.getValue("name");
  7. final String type = attrs.getValue("importType");
  8. final String location = attrs.getValue("location");
  9. final String namespace = attrs.getValue("namespace");
  10. emptyAttributeCheck(localName, "name", name, parser);
  11. if (type != null && location != null && namespace != null) {
  12. Map<String, String> typedImports = (Map<String, String>) process.getMetaData(type);
  13. if (typedImports == null) {
  14. typedImports = new HashMap<String, String>();
  15. process.setMetaData(type, typedImports);
  16. }
  17. typedImports.put(namespace, location);
  18. } else {
  19. java.util.Set<String> list = process.getImports();
  20. if (list == null) {
  21. list = new HashSet<String>();
  22. process.setImports(list);
  23. }
  24. list.add(name);
  25. }
  26. return null;
  27. }

代码示例来源:origin: org.jbpm/jbpm-flow-builder

  1. private String generateRules(final Process process) {
  2. StringBuffer builder = new StringBuffer();
  3. if ( process instanceof WorkflowProcessImpl ) {
  4. WorkflowProcessImpl ruleFlow = (WorkflowProcessImpl) process;
  5. builder.append( "package " + ruleFlow.getPackageName() + "\n" );
  6. Set<String> imports = ruleFlow.getImports();
  7. if ( imports != null ) {
  8. for ( String importString: imports ) {
  9. builder.append( "import " + importString + ";\n" );
  10. }
  11. }
  12. List<String> functionImports = ruleFlow.getFunctionImports();
  13. if ( functionImports != null ) {
  14. for ( String importString: functionImports ) {
  15. builder.append( "import function " + importString + ";\n" );
  16. }
  17. }
  18. Map<String, String> globals = ruleFlow.getGlobals();
  19. if ( globals != null ) {
  20. for ( Map.Entry<String, String> entry: globals.entrySet()) {
  21. builder.append( "global " + entry.getValue() + " " + entry.getKey() + ";\n" );
  22. }
  23. }
  24. Node[] nodes = ruleFlow.getNodes();
  25. generateRules(nodes, process, builder);
  26. }
  27. return builder.toString();
  28. }

代码示例来源:origin: kiegroup/jbpm

  1. public Object start(final String uri,
  2. final String localName,
  3. final Attributes attrs,
  4. final ExtensibleXmlParser parser) throws SAXException {
  5. parser.startElementBuilder( localName,
  6. attrs );
  7. WorkflowProcessImpl process = ( WorkflowProcessImpl ) parser.getParent();
  8. final String identifier = attrs.getValue( "identifier" );
  9. final String type = attrs.getValue( "type" );
  10. emptyAttributeCheck( localName, "identifier", identifier, parser );
  11. emptyAttributeCheck( localName, "type", type, parser );
  12. Map<String, String> map = process.getGlobals();
  13. if ( map == null ) {
  14. map = new HashMap<String, String>();
  15. process.setGlobals( map );
  16. }
  17. map.put( identifier, type );
  18. return null;
  19. }

代码示例来源:origin: kiegroup/jbpm

  1. processDescr.setName( "Process1" );
  2. WorkflowProcessImpl process = new WorkflowProcessImpl();
  3. process.setName( "Process1" );
  4. process.setPackageName( "pkg1" );

相关文章