[jBPM] - Set up jBPM5.4 Final Installer to use MySQL - or how to run section 3.7 of the User Guide
by iahi1998
iahi1998 [https://community.jboss.org/people/iahi1998] created the document:
"Set up jBPM5.4 Final Installer to use MySQL - or how to run section 3.7 of the User Guide"
To view the document, visit: https://community.jboss.org/docs/DOC-48374
--------------------------------------------------------------
I've started using jBPM 5.4 a couple weeks ago. It's my first forray into jBPM and I am slowly working through the user guide. I go to http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609 3.7. 10-Minute Tutorial: Using your own database with jBPM and got stuck.
First of all, credits. I thank https://community.jboss.org/people/thomas.setiabudi Thomas Setiabudi for posting the wonderful article titled https://community.jboss.org/docs/DOC-47975 Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS which I used for inspiration.
Second, shameless plug - https://sites.google.com/site/insearchofbpm/home/jbpm/on-ubuntu-desktop-1... my forray into jBPM which I will update as I make my way through the user guide.
And, last, but not least, the information,
My OS Ubuntu Desktop 12.04. If you are using Windows, be aware that you will have to rewrite paths with the backslashes "\" appropriate for your system..
The article is split into four steps:
* Set up MySQL
* Set up jBPM
* Install jBPM
* Run the demo using your own Database
h1. Set up MySQL
With MySQL installed, log in as the root user and run the following commands from the mysql> prompt:
mysql> CREATE SCHEMA IF NOT EXISTS jbpm5;
mysql> CREATE USER 'jbmp5'@'localhost' IDENTIFIED BY 'jbpm5';
mysql> GRANT ALL PRIVILEGES ON jbpm5.* TO 'jbpm5'@'localhost';
mysql> CREATE SCHEMA IF NOT EXISTS task;
mysql> CREATE USER 'task'@'localhost' IDENTIFIED BY 'task';
mysql> GRANT ALL PRIVILEGES ON task.* TO 'task'@'localhost;
h1. Set up jBPM
First, run
ant clean.demo
Second, you will have to change the following files:
* build.properties
* build.xml
* db/jbpm-persistence-JPA2.xml
* db/task-persistence-JPA2.xml
* standalone.xml
* task-service/resources/META-INF/persistence.xml
* lib/jbpm-gwt-console-server-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
* lib/jbpm-human-task-war-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
h2. build.properties
Change
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
db.name=h2
db.driver.jar.name=${db.name}.jar
db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${...
#other options are mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=${db.name}-connector-java.jar
# db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
To
# data base related properties
db.driver.jar=${install.home}/db/driver/${db.driver.jar.name}
db.driver.module.dir=${jboss.home}/modules/${db.driver.module.prefix}/main/
# default is H2
# db.name=h2
# db.driver.jar.name=${db.name}.jar
# db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${...
#other options are mysql
db.name=mysql
db.driver.module.prefix=com/mysql
db.driver.jar.name=${db.name}-connector-java.jar
db.driver.download.url=https://repository.jboss.org/nexus/service/local/r...
#postresql
# db.name=postresql
# db.driver.module.prefix=org/postgresql
# db.driver.jar.name=${db.name}-jdbc.jar
# db.driver.download.url=https://repository.jboss.org/nexus/content/reposit...
h2. build.xml
In
<!-- Start Demo -->
<target name="start.demo" depends="start.h2,start.jboss,start.eclipse" />
<!-- Start Demo (Eclipse) -->
<target name="start.demo.eclipse" depends="start.h2,start.eclipse" />
<!-- Start Demo (No Eclipse)-->
<target name="start.demo.noeclipse" depends="start.h2,start.jboss" />
<!-- Stop Demo -->
<target name="stop.demo" depends="stop.h2,stop.jboss" />
Add
<!-- Start Demo -->
<target name="start.demo" depends="start.h2,start.jboss,start.eclipse" />
<!-- Start Demo (DB) -->
<target name="start.demo.db" depends="start.jboss, start.eclipse" />
<!-- Start Demo (DB, No Eclipse) -->
<target name="start.demo.db.noeclipse" depends="start.jboss" />
<!-- Start Demo (Eclipse) -->
<target name="start.demo.eclipse" depends="start.h2,start.eclipse" />
<!-- Start Demo (No Eclipse)-->
<target name="start.demo.noeclipse" depends="start.h2,start.jboss" />
<!-- Stop Demo -->
<target name="stop.demo" depends="stop.h2,stop.jboss" />
<!-- Stop Demo (DB)-->
<target name="stop.demo.db" depends="stop.jboss" />
h2. db/jbpm-persistence-JPA2.xml
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
h2. db/task-persistence-JPA2.xml
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
h2. standalone.xml
Change
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:h2:~/jbpm</connection-url>
<driver>h2</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>sa</user-name>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
To
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/jbpm5</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>jbpm5</user-name>
<password>jbpm5</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
h2. task-service/resources/META-INF/persistence.xml
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:mysql:://localhost:3306/task" />
<property name="hibernate.connection.username" value="task"/>
<property name="hibernate.connection.password" value="task"/>
h2. lib/jbpm-gwt-console-server-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
To edit this file, take advantage of the GUI. Navigate to the .war file using Nautilus and rely on File Roller to open the .war file. File Roller should come pre-installed on Ubuntu Desktop 12.04. Once you're inside the .war file, you can use gedit to open persistence.xml. When you save, File Roller will ask if you want to update the archive and you must. On Window, 7-Zip can be used to open the .war file.
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
h2. lib/jbpm-human-task-war-5.4.0.Final-EE6.war/WEB-INF/classes/META-INF/persistence.xml
To edit this file, take advantage of the GUI. Navigate to the .war file using Nautilus and rely on File Roller to open the .war file. File Roller should come pre-installed on Ubuntu Desktop 12.04. Once you're inside the .war file, you can use gedit to open persistence.xml. When you save, File Roller will ask if you want to update the archive and you must. On Window, 7-Zip can be used to open the .war file.
Change
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
To
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
h1. Install jBPM
Run
ant install.demo
This will install the jBPM demo and pull all the appropriate drivers and files for MySQL.
h1. Run the demo using your own Database
To start the demo you can run
ant start.demo.db
or
ant start.demo.db.noeclipse
To stop the demo, run
ant stop.demo.db
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-48374]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 10 months
[JBoss Web Services] - JBossWS + CXF + Maven triggers
by stephen b
stephen b [https://community.jboss.org/people/slbanal] created the discussion
"JBossWS + CXF + Maven triggers"
To view the discussion, visit: https://community.jboss.org/message/798067#798067
--------------------------------------------------------------
Hi,
I am newbie in JBossWS and I am currently learning how to use JBossWS + CXF + Spring + Maven. I saw a quickstart project which uses JBossWS and Maven ( http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/helloworld-ws/ http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/helloworld-ws/) and used that as a starting point. In order to support CXF, I did the following changes (see attached files for details).
1. Modified this project by adding CXF and Spring as dependencies
2. Created applicationContext.xml under src/main/webapp/WEB-INF/
3. Created jbossws-cxf.xml under src/main/webapp/WEB-INF/
4. Modified web.xml to load applicationContext.xml and changes url of helloworld servlet
My JBoss server is version 7.1.1.FINAL using CXF 4.1.1.
Unfortunately, given this very simple change, this combination of libraries causes JBoss to throw an exception (example logs below). Any ideas as to what configuration / dependencies I have to add in my POM file to make this work. I did a bit of experimentation and renaming jbossws-cxf.xml to a temporary file name resolves the problem but this is not what i want to achieve. I want to enable JBossWS + CXF since I am planning to use Autowiring / injection feature of Spring with JBossWS-CXF.
17:52:01,872 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jboss-as-helloworld-ws].[HelloWorldService]] (http--127.0.0.1-8083-1) Servlet.service() for servlet HelloWorldService threw exception: java.lang.NoClassDefFoundError: javax/servlet/ServletException
at org.jboss.wsf.stack.cxf.Messages_$bundle.cannotObtainDestinationFor(Messages_$bundle.java:357)
at org.jboss.wsf.stack.cxf.RequestHandlerImpl.findDestination(RequestHandlerImpl.java:168)
at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:85)
at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:156)
at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:225)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:150)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi.jar:2.1.1.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_37]
Thanks,
Stephen
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/798067#798067]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[JBoss Messaging] - Re: Possible bug with JBoss Messaging on bisocket transport
by Vadim Kantor
Vadim Kantor [https://community.jboss.org/people/kantor] created the discussion
"Re: Possible bug with JBoss Messaging on bisocket transport"
To view the discussion, visit: https://community.jboss.org/message/798014#798014
--------------------------------------------------------------
Hi,
we are facing exaclty the same issue in JBoss EAP 5.1 with JBoss Remoting 2.5.3SP1.patch01
Thread dumps show many threads in BLOCKED state all waiting for an object that is locked by a thread in TIMED_WAITING state. So the will remain in that state until that thread times out:
"pmPublisherService-daemon-9" daemon prio=10 tid=0x00007fef4962c800 nid=0x3916 in Object.wait() [0x00007fef4c724000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007122bc720> (a java.util.HashSet)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.createSocket(BisocketClientInvoker.java:528)
- locked <0x00000007122bc720> (a java.util.HashSet)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1165)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:816)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:461)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:167)
<…>
- locked <0x000000072c411f78> (a java.lang.Object)
at org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.routeInternal(MessagingPostOffice.java:2504)
at org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.route(MessagingPostOffice.java:580)
"pmPublisherService-daemon-8" daemon prio=10 tid=0x0000000040d07800 nid=0x3915 waiting for monitor entry [0x00007fef4c765000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.jboss.messaging.core.impl.ChannelSupport.handle(ChannelSupport.java:242)
- waiting to lock <0x000000072c411f78> (a java.lang.Object)
at org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.routeInternal(MessagingPostOffice.java:2504)
But it hangs very long: longer as timeout from in remoting-bisocket-service.xml:
<attribute name="timeout" isParam="true">30000</attribute> (remoting-bisocket-service.xml)
Any information you can provide me would be greatly appreciated!
Best regards,
Vadim
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/798014#798014]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months
[jBPM] - Network configuration jBPM5.4 (with Bug Fixes)
by Cristian Ulloa
Cristian Ulloa [https://community.jboss.org/people/neo_2_3] modified the document:
"Network configuration jBPM5.4 (with Bug Fixes)"
To view the document, visit: https://community.jboss.org/docs/DOC-48369
--------------------------------------------------------------
To enable network access to jBPM 5.4, you must perform the following steps:
* Validate properly installed Java JDK+1.5 and Ant+1.7
* Download *jbpm-5.4.0.Final-installer-full.zip* (from JBoss jBPM Site)
* unzip folder
* Enter to folder */jbpm-installer*
* Edit file *standalone.xml* (modified to make red-labeled)* <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="*0.0.0.0*"/>
</virtual-server>
</subsystem>
* <subsystem xmlns="urn:jboss:domain:webservices:1.1">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>${jboss.bind.address:*0.0.0.0*}</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>
<endpoint-config name="Recording-Endpoint-Config">
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
</pre-handler-chain>
</endpoint-config>
</subsystem>
* <interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:*0.0.0.0*}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:*0.0.0.0*}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:*0.0.0.0*}"/>
</interface>
</interfaces>
* Edit file *build.xml* (with bug corrections Definition persistence configuration)* <property name="jboss.bind.address" value="*0.0.0.0*" />
* <!-- Install gwt-console -->
<target name="install.jBPM-gwt-console.into.jboss" depends="download.db.driver,download.jBPM.gwt-console">
<antcall target="install.jBPM-gwt-console.into.jboss5" />
<antcall target="install.jBPM-gwt-console.into.jboss7" />
</target>
<target name="install.jBPM-gwt-console.into.jboss7" depends="check.jboss.version" if="jboss.version.is.7">
<!-- download reporting -->
<antcall target="download.birt.as7" />
<!-- gwt-console -->
<mkdir dir="${install.home}/target"/>
<mkdir dir="${install.home}/target/jbpm-gwt-console-server-war"/>
<unzip src="${install.home}/lib/jbpm-gwt-console-server-${jBPM.version}-${deployment.version}.war"
dest="${install.home}/target/jbpm-gwt-console-server-war"/>
<copy todir="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/lib" overwrite="true">
<fileset dir="${install.home}/db/driver"/>
</copy>
<!-- Other configuration like work item handlers -->
<copy todir="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/classes" overwrite="true">
<fileset dir="${install.home}/conf"/>
</copy>
<!-- copy user defined persistence configuration if exists -->
<copy tofile="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/classes/META-INF/persistence.xml" overwrite="true"
file="${install.home}/db/jbpm-persistence*-JPA2*.xml" failonerror="false"/>
<copy tofile="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/classes/META-INF/ProcessInstanceInfoMapping.xml" overwrite="true"
file="${install.home}/db/ProcessInstanceInfoMapping.xml" failonerror="false"/>
* <!-- install reporting -->
<antcall target="install.reporting.into.jboss7" />
<!-- install dependencies -->
<antcall target="install.dependencies" />
<zip basedir="${install.home}/target/jbpm-gwt-console-server-war"
destfile="${install.home}/target/jbpm-gwt-console-server-${jBPM.version}.war"/>
<copy file="${install.home}/target/jbpm-gwt-console-server-${jBPM.version}.war"
tofile="${jboss.server.deploy.dir}/jbpm-gwt-console-server.war"
overwrite="true" />
<copy file="${install.home}/lib/jbpm-gwt-console-${jBPM.version}.war"
tofile="${jboss.server.deploy.dir}/jbpm-gwt-console.war"
overwrite="true" />
<delete dir="${install.home}/target"/>
<copy file="${install.home}/standalone.xml"
tofile="${jboss.home}/standalone/configuration/standalone.xml"
overwrite="true" />
<!-- authentication configuration -->
<copy file="${install.home}/auth/users.properties"
tofile="${jboss.server.conf.dir}/users.properties"
overwrite="true" />
<copy file="${install.home}/auth/roles.properties"
tofile="${jboss.server.conf.dir}/roles.properties"
overwrite="true" />
</target>
<target name="install.jBPM-gwt-console.into.jboss5" depends="check.jboss.version,install.transport.lib" unless="jboss.version.is.7">
<!-- download reporting -->
<antcall target="download.birt.as5" />
<!-- gwt-console -->
<mkdir dir="${install.home}/target"/>
<mkdir dir="${install.home}/target/jbpm-gwt-console-server-war"/>
<unzip src="${install.home}/lib/jbpm-gwt-console-server-${jBPM.version}-${deployment.version}.war"
dest="${install.home}/target/jbpm-gwt-console-server-war"/>
<!-- Other configuration like work item handlers -->
<copy todir="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/classes" overwrite="true">
<fileset dir="${install.home}/conf"/>
</copy>
<!-- copy user defined persistence configuration if exists -->
<copy tofile="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/classes/META-INF/persistence.xml" overwrite="true"
file="${install.home}/db/jbpm-persistence-*JPA2*.xml" failonerror="false"/>
<copy tofile="${install.home}/target/jbpm-gwt-console-server-war/WEB-INF/classes/META-INF/ProcessInstanceInfoMapping.xml" overwrite="true"
file="${install.home}/db/ProcessInstanceInfo.hbm.xml" failonerror="false"/>
* <!-- Install jbpm human task war -->
<target name="install.ht.war.into.jboss7" if="jboss.version.is.7">
<mkdir dir="${install.home}/target"/>
<mkdir dir="${install.home}/target/jbpm-human-task-war"/>
<unzip src="${install.home}/lib/jbpm-human-task-war-${jBPM.version}-${deployment.version}.war" dest="${install.home}/target/jbpm-human-task-war" />
<copy file="${install.home}/task-service/resources/war/web.xml"
tofile="${install.home}/target/jbpm-human-task-war/WEB-INF/web.xml"
overwrite="true" />
<!-- copy user defined persistence configuration if exists -->
<copy tofile="${install.home}/target/jbpm-human-task-war/WEB-INF/classes/META-INF/persistence.xml" overwrite="true"
file="${install.home}/db/task-persistence-*JPA2*.xml" failonerror="false"/>
<copy tofile="${install.home}/target/jbpm-human-task-war/WEB-INF/classes/META-INF/ProcessInstanceInfoMapping.xml" overwrite="true"
file="${install.home}/db/Taskorm*-JPA2*.xml" failonerror="false"/>
<zip basedir="${install.home}/target/jbpm-human-task-war"
destfile="${install.home}/target/jbpm-${jBPM.version}-human-task-war.war" />
<copy file="${install.home}/target/jbpm-${jBPM.version}-human-task-war.war"
tofile="${jboss.server.deploy.dir}/jbpm-human-task-war.war"
overwrite="true" />
<delete dir="${install.home}/target" />
</target>
* Enter to folder */conf*
* Edit file *default.jbpm.console.properties** jbpm.console.server.host=*0.0.0.0*
jbpm.console.server.port=8080
jbpm.console.task.service.strategy=HornetQ
jbpm.console.task.service.host=*0.0.0.0*
jbpm.console.task.service.port=5153
jbpm.console.directory=
guvnor.protocol=http
guvnor.host=*0.0.0.0*:8080
guvnor.subdomain=drools-guvnor
guvnor.usr=admin
guvnor.pwd=admin
guvnor.packages=
guvnor.connect.timeout=10000
guvnor.read.timeout=10000
guvnor.snapshot.name=LATEST
* Edit file *guvnor.preferences.propierties** #Designer configuration
designer.url=http://*0.0.0.0*:8080
#Do not change this unless you know what are you doing
designer.context=designer
designer.profile=jbpm#FormBuilder configuration
#Do not change this unless you know what are you doing
formbuilder.url=http://*0.0.0.0*:8080
formbuilder.context=jbpm-form-builder
formbuilder.profile=guvnor
* Back to folder */jbpm-installer*
* run command: ant install.demo.noeclipse
* run command: ant start.demo.noeclipse
* Verify access URL: http:// http://0.0.0.0:8080
* Access jBPM console: http:// http://0.0.0.0:8080/jbpm-console/app.html
* Access Drools-Guvnor: http:// http://0.0.0.0:8080/drools-guvnor/
Done.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-48369]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 10 months
[jBPM] - How to resume a process instance from a loaded session in jbpm 5.0
by Feki Ahmed
Feki Ahmed [https://community.jboss.org/people/bardelman] created the discussion
"How to resume a process instance from a loaded session in jbpm 5.0"
To view the discussion, visit: https://community.jboss.org/message/797952#797952
--------------------------------------------------------------
Hi,
i ve tried to load a session from the database with the loadStatefulKnowledgeSession, and then i tried to active a process Instance from that loaded session so i tried with ksession.startProcess(String processId) but it started a new process instance and not the old persisted one.
now i know that startProcess isn't the appropriate method to do that but i still don't know what's the right way ...
here is my code , it s a java class:
public static void main(String[] args) {
ksession = ReloadSession(SessionId, taskname);
UserTransaction ut = null;
try {
ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
} catch (NamingException e1) {
e1.printStackTrace();
}
try {
ut.begin();
} catch (NotSupportedException e) {
e.printStackTrace();
} catch (SystemException e) {
e.printStackTrace();
}
processInstance = ksession.startProcess(taskname);
ksession.fireAllRules();
try {
ut.commit();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
} catch (HeuristicMixedException e) {
e.printStackTrace();
} catch (HeuristicRollbackException e) {
e.printStackTrace();
} catch (RollbackException e) {
e.printStackTrace();
} catch (SystemException e) {
e.printStackTrace();
}
}
private StatefulKnowledgeSession ReloadSession(String tasktoreloadidSession,String tasktoreloadname){
StatefulKnowledgeSession ksession =null;
try {
UserTransaction ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
ut.begin();
ksession = JbpmAPIUtil.loadStatefulKnowledgeSession(Integer.parseInt(tasktoreloadidSession), tasktoreloadname+".bpmn");
/*Create the knowledge base */
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);
taskHandler.connect();
ut.commit();
logger.close();
} catch (Throwable t) {
log.error(t.getMessage(), t.getCause());
throw new RuntimeException("error while reloading session",t);
}
return ksession;
}
public static StatefulKnowledgeSession loadStatefulKnowledgeSession(int idsession,String processName) throws Exception {
/*
* Create the knowledgebase using the required bpmn and drl files
*/
KnowledgeBase kbase = readKnowledgeBase(processName);
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
return JPAKnowledgeService.loadStatefulKnowledgeSession(idsession,kbase, config, env);
}
unfortunatelly, the user guide do not talk about this enough. i need your help please !!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/797952#797952]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 10 months