Re: [jboss-user] [jBPM] - Handling process state
by David Jeeves
David Jeeves [http://community.jboss.org/people/jeevdav] replied to the discussion
"Handling process state"
To view the discussion, visit: http://community.jboss.org/message/545386#545386
--------------------------------------------------------------
This is what i am running.
testFindOne suceeds as expected, but testFindTwo and testFindThree fail unless all three are run together( when they are run together they use the same processengine and execution service)
The bottom line is that findProcessInstanceById works only when the same processengine is used. But in the realworld after i recycle my application how will i be able to resume my incomplete processes?
========================================================================
public class TestJBPM extends TestCase
{
protected static ProcessEngine processEngine = null;
protected static RepositoryService repositoryService;
protected static ExecutionService executionService;
protected static ManagementService managementService;
protected static TaskService taskService;
protected static HistoryService historyService;
protected static IdentityService identityService;
@Override
protected void setUp() throws Exception {
super.setUp();
if (processEngine==null) {
processEngine = Configuration.getProcessEngine();
repositoryService = processEngine.get(RepositoryService.class);
executionService = processEngine.getExecutionService();
historyService = processEngine.getHistoryService();
managementService = processEngine.getManagementService();
taskService = processEngine.getTaskService();
identityService = processEngine.getIdentityService();
}
}
public void testFindOne() {
repositoryService.createDeployment()
.addResourceFromClasspath("com/test/Proc.jpdl.xml")
.deploy();
ProcessInstance processInstance = executionService.startProcessInstanceByKey("Proc","t");
System.out.println("process id "+processInstance.getId());
Execution executionInA = processInstance.findActiveExecutionIn("a");
assertNotNull(executionInA);
//processInstance = executionService.signalExecutionById(executionInA.getId());
processInstance = executionService.findProcessInstanceById("Proc.t");
assertNotNull(processInstance);
}
public void testFindTwo() {
ProcessInstance processInstance = executionService.findProcessInstanceById("Proc.t");
assertNotNull(processInstance);
}
public void testFindThree() {
repositoryService.createDeployment()
.addResourceFromClasspath("com/test/Proc.jpdl.xml")
.deploy();
ProcessInstance processInstance = executionService.findProcessInstanceById("Proc.t");
assertNotNull(processInstance);
}
}
===========================
The test process
=======================
+<?xml version="1.0" encoding="UTF-8"?>+
+<process name="Proc" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start name="start1" g="121,59,48,48">
<transition name="to a" to="a" g="-25,-20"/>
</start>
<state name="a" g="107,134,92,52">
<transition name="to b" to="b" g="-26,-20"/>
</state>
<state name="b" g="111,207,92,52">
<transition name="to c" to="c" g="-25,-20"/>
</state>
<state name="c" g="118,271,92,52">
<transition name="to end1" to="end1" g="-45,-20"/>
</state>
<end name="end1" g="134,344,48,48"/>
</process>+
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/545386#545386]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [jBPM] - Handling process state
by David Jeeves
David Jeeves [http://community.jboss.org/people/jeevdav] replied to the discussion
"Handling process state"
To view the discussion, visit: http://community.jboss.org/message/545385#545385
--------------------------------------------------------------
*package
com.test;
*import
junit.framework.TestCase;
*import
org.jbpm.api.Configuration;*import
org.jbpm.api.Execution;*import
org.jbpm.api.ExecutionService;*import
org.jbpm.api.HistoryService;*import
org.jbpm.api.IdentityService;*import
org.jbpm.api.ManagementService;*import
org.jbpm.api.ProcessEngine;*import
org.jbpm.api.ProcessInstance;*import
org.jbpm.api.RepositoryService;*import
org.jbpm.api.TaskService;
*public
*class TestJBPM *extends TestCase{
*protected *static ProcessEngine +processEngine = *null;
*protected *static RepositoryService +repositoryService;
*protected *static ExecutionService +executionService;
*protected *static ManagementService +managementService;
*protected *static TaskService +taskService;
*protected *static HistoryService +historyService;
*protected *static IdentityService +identityService;
@Override
*protected *void setUp() *throws Exception {
*super.setUp();
*if (+processEngine==*null) {
+processEngine = Configuration.+getProcessEngine+();
+repositoryService = +processEngine.get(RepositoryService.*class);
+executionService = +processEngine.getExecutionService();
+historyService = +processEngine.getHistoryService();
+managementService = +processEngine.getManagementService();
+taskService = +processEngine.getTaskService();
+identityService = +processEngine.getIdentityService();}
}
*public *void testFindOne() {
+repositoryService.createDeployment().addResourceFromClasspath(
"com/test/Proc.jpdl.xml").deploy();
ProcessInstance processInstance =
+executionService.startProcessInstanceByKey("Proc","t");System.
+out.println("process id "+processInstance.getId());
Execution executionInA = processInstance.findActiveExecutionIn(
"a");+assertNotNull+(executionInA);
//processInstance = executionService.signalExecutionById(executionInA.getId());processInstance =
+executionService.findProcessInstanceById("Proc.t");+assertNotNull+(processInstance);
}
*public *void testFindTwo() {
ProcessInstance processInstance =
+executionService.findProcessInstanceById("Proc.t");+assertNotNull+(processInstance);
}
*public *void testFindThree() {
+repositoryService.createDeployment().addResourceFromClasspath(
"com/test/Proc.jpdl.xml").deploy();
ProcessInstance processInstance =
+executionService.findProcessInstanceById("Proc.t");+assertNotNull+(processInstance);
}
}
+
+
**
+
**
+
+
+
+
**
++
++
++
++
++
*++
+
*+*
*
***
+**
+**
+**
+**
+**
+**
*+**
**
*
*
*
*
*
*
*
*
*
*
*
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/545385#545385]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
jndi environment
by João Galaio da Silva
Hi everybody,
does anyone knows how to set jndi context properties so i can acess them by
lookup java:comp/env/
without the need to specify this inside a war or ear.
For example, i have this configuration in tomcat 6:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Context antiResourceLocking="false" privileged="true">
<Environment description="" name="cas/serverName" override="false"
type="java.lang.String" value="http://localhost:8080"/>
<Environment description=""
name="cas/AuthenticationFilter/casServerLoginUrl" override="false"
type="java.lang.String" value="https://www.ja-sig.org/cas/login"/>
<Environment description=""
name="cas/Cas20ProxyReceivingTicketValidationFilter/casServerUrlPrefix"
override="false"
type="java.lang.String" value="https://www.ja-sig.org/cas"/>
</Context>
How can this be done in jboss-tomcat?
Thanks,
João
15 years, 10 months
[jBPM] - jBPM timer not executing/firing
by jDev Dev
jDev Dev [http://community.jboss.org/people/dSalam] created the discussion
"jBPM timer not executing/firing"
To view the discussion, visit: http://community.jboss.org/message/545355#545355
--------------------------------------------------------------
I am using Eclipse v3 with jbpm 3.2.3
I have a timer in my process definition that should send an email once it fires.
It seems the timer never fires and I am not sure why.
- I included all services in jbpm-context
- my timers are being stored in the databse ( Ican see the tables populating)
- am I missing a class that schedules the timers to run (I thought that the scheduler service takes care of that)???
If I remove the timer from the state and keep the mail statement (to send mail), it WORKS ... so it seems my timer is not firing
** I have tried using event (with <create-timer>), state (with <timer>), a simple system.out but to no avail
Any insight would be appreciated
HERE's all the files I am using for this simple java application
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/545355#545355]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months