1 Reply Latest reply on Oct 19, 2011 3:48 AM by Chris Melas

    Starting up jBPM 5.1

    Johan Arif Ariffin Newbie

      Hi i am wondering if there's a cleaner way to start up jBPM 5.1 other than using ant start.demo . Right now i am using jBPM 3.2 enterprise edition and i only have to do a run -c <server instance> and it loads up all of the workflow component.Is it possible to do the same thing with jBPM 5.1?


      Many thanks in advance.



        • 1. Re: Starting up jBPM 5.1
          Chris Melas Apprentice



          If you take a look inside build.xml at the target start.demo you will see that all it does is to start jboss, h2, human task, eclipse. So in a production/development/staging server environment you will probably use an RDBMS that is always started, so no need for start.h2, you will probably not care if eclipse is started at your server or even on your system you can start eclipse yourself so no need for start.eclipse. Now regarding jboss of course you will always need to start jboss, possibly with your own parameters. Starting jboss through ant i.e. ant start.jboss is like run from bin folder of jboss, however it also sets some parameters (i.e. memory related, bind address etc) so you can either set those parameters or your own parameters in run script of jboss or simply use the ant mechanism which is pretty flexible and straight forward.


          So basically all you need is ant start.jboss if running from ant or execute the jboss run script. Regarding the human task you also have to start it because it is a separate java application. So you can either run it localy by calling ant start.human.task, or you can wrap it in a web application deploy it on jboss and no need for ant start.human.task.


          Please note that if you take the human task web application route, in order to propertly initialize the users, groups and the database tables (the first time), you will have to make an http request to the human task web application when the server starts. This is easily done in ant, for example add the code below inside the start.jboss ant target just before the closing tag </target>



          <fail if="jboss.timeout" message="jboss did not start within 5 minutes"/>

          <echo message="jboss started..." />


          <waitfor maxwait="2" maxwaitunit="minute" checkevery="30"

          checkeveryunit="second" timeoutproperty="taskService.timeout">

          <http url="http://${jboss.bind.address}:yourPort/HumanTaskServiceWebApplication"/>


          <fail if="taskService.timeout" message="taskService did not start"/>


          <get src="http://${jboss.bind.address}:yourPort/HumanTaskServiceWebApplication" dest="${install.home}/" /><!--you can even use an http get-->

          <echo message="task service started..." />


          So to conclude,

          either call ant start.jboss;ant start.human.task; or bin/run .....; ant start.human.task; or the call to start.human.task can also go inside the run script ....

          or make the human task a web app and just call ant start.jboss with the extra code above.