[jBPM] - jBPM5 Console Integration with Tomcat6
by bpmn2 user
bpmn2user [http://community.jboss.org/people/bpmn2user] created the discussion
"jBPM5 Console Integration with Tomcat6"
To view the discussion, visit: http://community.jboss.org/message/578103#578103
--------------------------------------------------------------
Here are the required steps to get the jBPM5 console running in Tomcat6
1.) Copy the console war files provided in JBPM_INSTALLER/lib into Tomcat’s webapps directory
These war files can also be downloaded from ( http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.0-CR1/jbpm-5.0... http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.0-CR1/jbpm-5.0...). This download has two war files jbpm-gwt-console-5.0-CR1.war and jbpm-gwt-console-server-5.0-CR1.war. Rename them to jbpm-console.war and gwt-console-server.war and copy them to TOMCAT_HOME/webapps
2.) Create users and roles in TOMCAT_HOME/conf/tomcat-users.xml.
Here is an example
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="user"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="manager" password="manager" roles="manager"/>
<user username="krisv" password="krisv" roles="manager,admin,user"/>
<user username="john" password="john" roles="manager,admin,user"/>
<user username="mary" password="mary" roles="manager,admin,user"/>
</tomcat-users>
3.) Set the jbpm.console.directory in Catalina.bat (.sh)
Here is an example.
.. -Djbpm.console.directory=C:/jbpm5/CR1/jbpm-installer/sample/evaluation/src/main/resources ..
4.) Copy JBPM_INSTALLER\jboss-4.2.3.GA server\default\data\birt into TOMCAT_HOME\birt. This will provide the reporting functionality
5.) Copy the database driver (e.g., h2.jar) and all the dependant jar files into TOMCAT_HOME/lib.
Here are the required libraries:
jbpm-persistence-jpa-5.0-CR1.jar
h2-1.2.124.jar
persistence-api-1.0.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
javassist-3.4.GA.jar
hibernate-entitymanager-3.4.0.GA.jar
hibernate-core-3.3.0.SP1.jar
hibernate-commons-annotations-3.1.0.GA.jar
hibernate-annotations-3.4.0.GA.jar
ejb3-persistence-1.0.2.GA.jar
dom4j-1.6.1.jar
commons-collections-3.1.jar
antlr-2.7.6.jar
6.) Start database:
e.g, run ‘ant h2.start’ from JBPM_INSTALLER directory
7.) Start human task, e.g., run ‘ant start.human.task’ from JBPM_INSTALLER directory
This assumes that a datasource JNDI (jdbc/testDS1) is configured in Tomcat and a transaction manager (such as Bitronix or JOTM or Atomikos etc) is configured on Tomcat.
Refer to http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html for JNDI configuration on Tomcat6.
Login to console http://localhost:8080/jbpm-console http://localhost:8080/jbpm-console (krisv/krisv)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/578103#578103]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[jBPM] - jBPM5.1 : Setting Process Variable from code(Using API)
by Sandeep Sapra
Sandeep Sapra [http://community.jboss.org/people/sandeepsapra] created the discussion
"jBPM5.1 : Setting Process Variable from code(Using API)"
To view the discussion, visit: http://community.jboss.org/message/635990#635990
--------------------------------------------------------------
*Description :*
I am trying to create a business process having two tasks :
a) Enter Comments Task to be entered by author and
b) Verify comments Task : To approve or reject comments entered by author.
If the comments are approved the process will end and if it is rejected , control will flow back to user task to enter comments by author.
Approve is set in BPMN by setting a process variable : approvalStatus as 1 and for reject it i set to 0.
Eg:
<conditionExpression xsi:type="tFormalExpression" language=" http://www.java.com/java http://www.java.com/java" >
return approvalStatus.equals("1");
</conditionExpression>
*Problem:*
While starting the process, approvalStatus is set to 0 intially as :
Map<String, Object> params = new HashMap<String, Object>();
params.put("approvalStatus", "0");
// start a new process instance
pi = ksession.startProcess("com.sample.bpmn.comments",params);
I am then trying to set the process variable as 1 or 0 (depending on approve or reject) inside the code , but the same is not happening.
*Can anyone please tell if I am missing something or is there any other way to do so?*
*Code Snippet:*
//Some Code here.....................
String approvalStatusValue="0";
if(isCommentsApproved)
approvalStatusValue="1";
else
approvalStatusValue="0";
Map<String, Object> results = new HashMap<String, Object>();
results.put("approvalStatus", approvalStatusValue);
ContentData contentData = new ContentData();
contentData = new ContentData();
contentData.setAccessType(AccessType.Inline);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream out;
try {
out = new ObjectOutputStream(bos);
out.writeObject(results);
out.close();
contentData = new ContentData();
contentData.setContent(bos.toByteArray());
contentData.setAccessType(AccessType.Inline);
} catch (IOException e) {
e.printStackTrace();
}
taskClient.complete(task1.getId(), "mary", contentData, taskOperationHandler);
Thanks and Regards,
Sandeep
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/635990#635990]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[jBPM] - How to setVariable after JPAKnowledgeService.loadStatefulKnowledgeSession
by Jack Q tao
Jack Q tao [http://community.jboss.org/people/qintao1203] created the discussion
"How to setVariable after JPAKnowledgeService.loadStatefulKnowledgeSession"
To view the discussion, visit: http://community.jboss.org/message/636928#636928
--------------------------------------------------------------
Hi all,
I write some code to change variables of process , but it can't work .
The error info:
java.lang.NullPointerException
at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)
at org.jbpm.process.instance.impl.ProcessInstanceImpl.getContextInstance(ProcessInstanceImpl.java:127)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setVariable(WorkflowProcessInstanceImpl.java:237)
My code :
KnowledgeBase kbase = createKnowledgeBase();
StatefulKnowledgeSession ksession =JPAKnowledgeService.loadStatefulKnowledgeSession(jbpm.getSessionId(), kbase, null, getEnv() );
CommanWSHumanTaskHandler humanTaskHandler = new CommanWSHumanTaskHandler(ksession);
humanTaskHandler.setClient(taskClientWrapper.getTaskClient());
humanTaskHandler.setSessionId(ksession.getId());
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);
humanTaskHandler.connect();
ProcessInstance pi = ksession.getProcessInstance(jbpm.getProcessId());
Boolean isSign = (Boolean) ((WorkflowProcessInstance)pi).getVariable("isSign");
List<String> list = (List<String>) ((WorkflowProcessInstance)pi).getVariable("signers"); // *isSign* and *list* are not null*.*
((WorkflowProcessInstance)pi).setVariable("isSign", true); // throws exception
((WorkflowProcessInstance)pi).setVariable("signers", signers);
ksession.insert(pi);
I don't understand why. and How to fix it.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/636928#636928]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[Beginner's Corner] - Hypersonic databases
by Willem Noorduin
Willem Noorduin [http://community.jboss.org/people/willemnoorduin] created the discussion
"Hypersonic databases"
To view the discussion, visit: http://community.jboss.org/message/636771#636771
--------------------------------------------------------------
We have implemented JBoss-clustering (JBoss 5.1.1.GA) with success, only to be production ripe, it is in general recommended to replace the Hypersonic Database with another (say Oracle or MySQL). The technical aspect is clear, just replace your hypersonic datasource with another JDBC Connector to DefaultDS and let JBoss take care of the rest. There are a few questions:
* I have seen one Hypersonic database connection per JBoss profile. Does this mean we have to implement n seperated Oracle databases when we run n JBoss profiles, or can you do it per cluster (so, if 4 JBoss-profiles form a JBoss cluster, point these to the same Oracle database ? Notice I am using Oracle here because I want to stress the cost aspect, and yes, I know that MySQL won't cost you anything).
* What information is saved to the database when you are using all the capacities of JBoss ? (I only saw one counter, but then again, I just ran some rediculously easy test application).
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/636771#636771]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years