3 Replies Latest reply on Feb 15, 2008 12:04 PM by Ronald van Kuijk

    simple question

    Michael Lauer Newbie

      I understand jdpl, know how to create, unit test, deploy, and debug a process.

      I created a process with a timer in it that works.

      Now, all I want to do is create a class that gets a process instance from that same db that that console sees (public), starts it up in the engine, so that I can see my printlns in the console when the timer goes off every 30 seconds.

      What must I do to the cfg files so that when I get the jbpmContext and use it to get a process, I am getting it from the right db schema and starting it up in the right server?

      It seems all I can manage to do is pull back the graph and walk it in my code, but not launch it in the server.

      Obviously, my code is running in the eclipse Jbpm jvm and the server is running in its own jvm, so it seems I am missing something obvious and fundamental like, how to connect to the server using webservices.

      Any help without excessively nasty rtfm comments would be appreciated since I keep rtfm and yet still manage to stay in the dark on this simple, essential issue.

        • 1. Re: simple question
          Ronald van Kuijk Master

          rtfm is not all info there is. There are also a lot of unittests in the source that can shed some light on these issues.

          The question I have is: "what do you mean by launch it in the server?"

          Connecting to the server via webservices is not possible as you probably have (not) read in the fine manual (since it is not in there) and you probably have seen the jira issues on implementing those and read the forum posts about them.

          • 2. Re: simple question
            Michael Lauer Newbie

            What I mean by launch in the server is:
            1) I use the designer to create a process and unit tests that work as I intend
            2) I deploy the process to the server, it works as I intend, I can interact with it from the console
            3) Now, I want to write a class that starts a new instance of the process in the server. That's all. That class will be imported into a drool so that, under the right conditions, we will launch a new instance of the process.

            In other words, now that I have successfully created, debugged, and deployed a good process, how do I launch a new instance of it programmitically? All I want to do is exactly what the jbpm console does: possibly get a list of deployed processes, and start up a new instance of one.

            This exact use has to be the raison d'etre of jbpm, and the web console does it, so I figure I must be missing something really basic and obvious to not grasp how I correctly do jbpmContext.getProcessInstance(processId). The only way this works when I try it is if I first parse the process, create the schema, store the process, and then get it back, which means the instance of the Jbpm server I am talking to is my own, not the one used by the console, not the one started up by start.bat

            • 3. Re: simple question
              Ronald van Kuijk Master

              3) then just write a class that does that... the most basic examples do exactly this.

              - open context
              - search process instance
              - do work
              - close context

              (do not have an explicit example at hand)