2 Replies Latest reply on May 27, 2014 8:12 AM by ankitgr8

    I want to create jbpmn as an standalone service.

    ankitgr8

      I wrote a main method and try to run simple bpmn process with out any presistence and transaction and any jboss. Below are the sample code I have written

       

      KieHelper kie =  new KieHelper();

              setupWorkFlows(kie);

              ksession = kie.build().newKieSession();

              setUpWorkItemHandler();

              ksession.startProcess("Customer.bpmn");

       

      setupWorkFlow = this method add the resources in the knowledge base

      setUpWorkItemHandler - set the handler to the associated task.

       

      This always give me following error

       

      Exception in thread "main" java.lang.IllegalArgumentException: Unknown process I

      D: Customer.bpmn

              at org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(Pr

      ocessRuntimeImpl.java:217)

              at org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(Pr

      ocessRuntimeImpl.java:178)

              at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRunt

      imeImpl.java:168)

              at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRunt

      imeImpl.java:163)

              at org.drools.core.common.AbstractWorkingMemory.startProcess(AbstractWor

      kingMemory.java:1575)

              at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(Statef

      ulKnowledgeSessionImpl.java:361)

        • 1. Re: I want to create jbpmn as an standalone service.
          salaboy21

          That's because you need to add the bpmn2 file to the kie container. And then you should start it with the process id no the file name.

          Regards

          • 2. Re: I want to create jbpmn as an standalone service.
            ankitgr8

            I am doing the same when I Said setupWorkFlow = this method add the resources in the knowledge base..below is the code ---let me know if i am missing out something

             

            private void setupWorkFlows(KieHelper kie){

               

                    List<String> bpmnfiles = findBPMNFiles();

                    Map<String,ResourceType> resourceList = new HashMap<String,ResourceType>(bpmnfiles.size());

                   

                    for(String bpmnfile :bpmnfiles){

                        System.out.println("file name " + bpmnfile);

                         kie = kie.addResource(ResourceFactory.newFileResource(bpmnfile));

                    }

                   

                }