2 Replies Latest reply on Jan 2, 2017 12:29 PM by hakaisha

    Update PRocess JBPM 6.1

    hakaisha Newbie

      Hello, I have a problem.

       

      I have written a Java application that creates a KieSession and loads some processes. But i need to update some processes or add new processes to KieSession on Runtime.

       

      But i couldnt find some way to do this...

       

      Can someyone help me?

        • 1. Re: Update PRocess JBPM 6.1
          Abhijit Humbe Master

          To upgrade existing process instances you can use WorkflowProcessInstanceUpgrader API. To add new assets(rules/bpmn process) at runtime you can use kieScanner API's.

          • 2. Re: Update PRocess JBPM 6.1
            hakaisha Newbie

            Thank you.

            To explane it better, can i use the apis with my Java code?

             

            private void createKieSession(String kSessionName, String kieResourceFolder) {

                    try {

             

                        KieServices kService = KieServices.Factory.get();

                   

                        KieRepository kRepository = kService.getRepository();

             

                        KieModule kModule = kRepository

                                .addKieModule(kService.getResources().newFileSystemResource(kieResourceFolder))

             

                        KieContainer kContainer = kService.newKieContainer(kModule.getReleaseId());

             

                        kieSession = kContainer.newKieSession(kSessionName);

             

                    } catch (Throwable t) {

                        throw t;

                    }

                }

             

            public void fire() {

                    kieSession.signalEvent(SIGNAL_NAME, DO_NOT_CLOSE, processInstance.getId());

                }

             

            public void startProcess() {

                    try {

                        processInstance = kieSession.createProcessInstance(processInfo.getProcessID(), parameterContainerMap);

                        kieSession.startProcessInstance(processInstance.getId());

                    } catch (Throwable t) {

                        logger.catching(t);

                        throw t;

                    }

                }