Package org.jbpm.bpmn2.xml

Examples of org.jbpm.bpmn2.xml.BPMNDISemanticModule


    public void testAdHocSubProcess() throws Exception {
    KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
    ((PackageBuilderConfiguration) conf).initSemanticModules();
    ((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNSemanticModule());
    ((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNDISemanticModule());
        ((PackageBuilderConfiguration) conf).addDialect("XPath", new XPathDialectConfiguration());
    XmlProcessReader processReader = new XmlProcessReader(
          ((PackageBuilderConfiguration) conf).getSemanticModules());
    RuleFlowProcess p = (RuleFlowProcess)
        processReader.read(SimpleBPMNProcessTest.class.getResourceAsStream("/BPMN2-AdHocSubProcess.xml"));
View Full Code Here


    public void testAdHocSubProcessAutoComplete() throws Exception {
    KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
    ((PackageBuilderConfiguration) conf).initSemanticModules();
    ((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNSemanticModule());
    ((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNDISemanticModule());
        ((PackageBuilderConfiguration) conf).addDialect("XPath", new XPathDialectConfiguration());
    XmlProcessReader processReader = new XmlProcessReader(
          ((PackageBuilderConfiguration) conf).getSemanticModules());
    RuleFlowProcess p = (RuleFlowProcess)
        processReader.read(SimpleBPMNProcessTest.class.getResourceAsStream("/BPMN2-AdHocSubProcessAutoComplete.xml"));
View Full Code Here

  private KnowledgeBase createKnowledgeBase(String process) throws Exception {
    KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
    ((PackageBuilderConfiguration) conf).initSemanticModules();
    ((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNSemanticModule());
    ((PackageBuilderConfiguration) conf).addSemanticModule(new BPMNDISemanticModule());
        ((PackageBuilderConfiguration) conf).addDialect("XPath", new XPathDialectConfiguration());
    XmlProcessReader processReader = new XmlProcessReader(
          ((PackageBuilderConfiguration) conf).getSemanticModules());
    RuleFlowProcess p = (RuleFlowProcess)
        processReader.read(SimpleBPMNProcessTest.class.getResourceAsStream("/" + process));
View Full Code Here

    @SuppressWarnings("unchecked")
  public void start(BundleContext bc) throws Exception {
        System.out.println( "registering jBPM BPMN2 process services" );
        this.bpmn2ProcessReg = bc.registerService( new String[]{ BPMN2ProcessProvider.class.getName(), Service.class.getName()},
                                                   new BPMN2ProcessProviderImpl(),
                                                   new Hashtable() );

        System.out.println( "jBPM BPMN2 process services registered" );
    }
View Full Code Here

 
  public Object start(final String uri, final String localName,
      final Attributes attrs, final ExtensibleXmlParser parser)
      throws SAXException {
    parser.startElementBuilder(localName, attrs);
    DataStore store = new DataStore();
    store.setId(attrs.getValue("id"));
    store.setName(attrs.getValue("name"));
    final String itemSubjectRef = attrs.getValue("itemSubjectRef");
    store.setItemSubjectRef(itemSubjectRef);
    Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>)
      ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions");
    // retrieve type from item definition
    //FIXME we bypass namespace resolving here. That's not a good idea
    // when we start having several documents, with imports.
    String localItemSubjectRef = itemSubjectRef.substring(
        itemSubjectRef.indexOf(":") +1);
    DataType dataType = new ObjectDataType();
    if (itemDefinitions != null) {
      ItemDefinition itemDefinition = itemDefinitions.get(localItemSubjectRef);
      if (itemDefinition != null) {
        dataType = new ObjectDataType(itemDefinition.getStructureRef());
      }
    }
    store.setType(dataType);
   
    Definitions parent = (Definitions) parser.getParent();
    List<DataStore> dataStores = parent.getDataStores();
    if (dataStores == null) {
      dataStores = new ArrayList<DataStore>();
View Full Code Here

  public Object start(final String uri, final String localName,
                  final Attributes attrs, final ExtensibleXmlParser parser)
      throws SAXException {
    parser.startElementBuilder(localName, attrs);
    return new Definitions();
  }
View Full Code Here

  }

  public Object end(final String uri, final String localName,
                final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    Definitions definitions = (Definitions) parser.getCurrent();
        String namespace = element.getAttribute("targetNamespace");
        List<Process> processes = ((ProcessBuildData) parser.getData()).getProcesses();
        for (Process process : processes) {
            RuleFlowProcess ruleFlowProcess = (RuleFlowProcess)process;
            ruleFlowProcess.setMetaData("TargetNamespace", namespace);
        }
        definitions.setTargetNamespace(namespace);
        return definitions;
  }
View Full Code Here

     
      visitEscalations(process.getNodes(), xmlDump, new ArrayList<String>());
      visitErrors(process.getNodes(), xmlDump, new ArrayList<String>());
        
      //data stores
      Definitions def = (Definitions) process.getMetaData().get("Definitions");
      if (def != null && def.getDataStores() != null) {
        for (DataStore dataStore : def.getDataStores()) {
          visitDataStore(dataStore, xmlDump);
        }
      }
     
      // the process itself
    xmlDump.append("  <process processType=\"Private\" isExecutable=\"true\" ");
        if (process.getId() != null) {
            xmlDump.append("id=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(process.getId()) + "\" ");
        }
        if (process.getName() != null) {
            xmlDump.append("name=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(process.getName()) + "\" ");
        }
        String packageName = process.getPackageName();
        if (packageName != null && !"org.drools.bpmn2".equals(packageName)) {
            xmlDump.append("tns:packageName=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(packageName) + "\" ");
        }
        if (((org.jbpm.workflow.core.WorkflowProcess) process).isDynamic()) {
          xmlDump.append("tns:adHoc=\"true\" ");
        }
        String version = process.getVersion();
        if (version != null && !"".equals(version)) {
            xmlDump.append("tns:version=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(version) + "\" ");
        }
        // TODO: package, version
        xmlDump.append(">" + EOL + EOL);
        visitHeader(process, xmlDump, metaDataType);
        visitNodes(process, xmlDump, metaDataType);
        visitConnections(process.getNodes(), xmlDump, metaDataType);
        if (def != null && def.getAssociations() != null) {
          for (Association association : def.getAssociations()) {
            visitAssociation(association, xmlDump);
          }
        }
        xmlDump.append("  </process>" + EOL + EOL);
        if (metaDataType == META_DATA_USING_DI) {
View Full Code Here

        dataType = new ObjectDataType(itemDefinition.getStructureRef());
      }
    }
    store.setType(dataType);
   
    Definitions parent = (Definitions) parser.getParent();
    List<DataStore> dataStores = parent.getDataStores();
    if (dataStores == null) {
      dataStores = new ArrayList<DataStore>();
      parent.setDataStores(dataStores);
    }
    dataStores.add(store);
    return store;
  }
View Full Code Here

                  Map<String, Error> errors = (Map<String, Error>)
                    ((ProcessBuildData) parser.getData()).getMetaData("Errors");
                if (errors == null) {
                    throw new IllegalArgumentException("No errors found");
                }
                Error error = errors.get(errorRef);
                if (error == null) {
                    throw new IllegalArgumentException("Could not find error " + errorRef);
                }
                String type = error.getErrorCode();
                    List<EventFilter> eventFilters = new ArrayList<EventFilter>();
                    EventTypeFilter eventFilter = new EventTypeFilter();
                    eventFilter.setType("Error-" + attachedTo + "-" + type);
                    eventFilters.add(eventFilter);
                    eventNode.setEventFilters(eventFilters);
View Full Code Here

TOP

Related Classes of org.jbpm.bpmn2.xml.BPMNDISemanticModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.