2 Replies Latest reply on Jun 19, 2009 1:17 AM by shekharv

    how to get a processEngine already created?

      With jbmp4 all the examples do a deployment first so everything is deleted.

      can anybody post a code of how to get the processEngine and all that's needed for a processInstance already created??

      the other question is that every time I do a deploy of the examples all users are deleted (JBPM4_ID_USER table) . I don't want to delete the users. how do I do that???

        • 1. Re: how to get a processEngine already created?
          shekharv

          If you do not want the tables to be redeployed everytime,
          change the property below in jbpm.hibernate.cfg.xml
          update

          If you do not want to delete the users, just comment out those statements in the respective testcases. The testcases do not assume anything as to what can or cannot be present and hence attempt creating a pristine environment and then clean up after they are done, which is what any good test should do(as much as possible).
          This is an example from the TaskCandidatesTest. You can delete the identityService calls if u really want to avoid the deletion.
          protected void tearDown() throws Exception {
          // delete process deployment
          repositoryService.deleteDeploymentCascade(deploymentDbid);

          // delete identities
          identityService.deleteGroup("sales-dept");
          identityService.deleteUser("johndoe");
          identityService.deleteUser("joesmoe");

          super.tearDown();
          }

          HTH,

          • 2. Re: how to get a processEngine already created?
            shekharv

            As for the other part of your question regarding retrieving created processInstances, you can configure the same way the test cases are doing this, that will give you the environment and processengine, but also then simply use the ExecutionService methods

            ProcessInstance findProcessInstanceById(String processInstanceId);


            All you need to do is give the id of the processInstance that you want to load up.