[jBPM Users] - Re: Problem moving from 4.1 to 4.2 using Spring configuratio
by RockerRocker
I was getting NullPointerException but after adding command service name i am getting this error -
Caused by:
org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pv
m.internal.cfg.SpringConfiguration.buildProcessEngine()] threw exception; nested exception is org.springframework.transaction
.IllegalTransactionStateException: No existing transaction found for transaction marked with propagation 'mandatory'
Caused by:
org.springframework.transaction.IllegalTransactionStateException: No existing transaction found for transaction marked with p
ropagation 'mandatory'
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransact
ionManager.java:339)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:124)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.checkDb(ProcessEngineImpl.java:177)
at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.buildProcessEngine(ProcessEngineImpl.java:170)
at org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine(SpringConfiguration.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265968#4265968
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265968
16 years, 4 months
[jBPM Users] - Re: [jBPM 4.2] MySQLIntegrityConstraintViolationException en
by xalperte
Yep! sorry.
I deleted some stuff from the previous process definition in order to run it without problems (some custom listeners).
Here the process definition:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="Test Websale" xmlns="http://jbpm.org/4.2/jpdl">
| <swimlane assignee="${buyer}" name="Buyer"/>
| <swimlane candidate-groups="sales" name="Sales Representative"/>
| <swimlane assignee="jim" name="Finantial Department"/>
| <swimlane assignee="luci" name="Shippment Department"/>
|
| <start form="tasks/form.create.xhtml" g="81,126,48,48" name="Create new web sale order">
| <transition g="-51,-24" name="Start web sale" to="Evaluate web order"/>
| </start>
|
| <task form="tasks/form.evaluate.xhtml" g="209,110,153,80" name="Evaluate web order" swimlane="Sales Representative">
| <reminder duedate="1 day" repeat="4 hours"/>
| <transition g="220,245:-67,-3" name="More info needed" to="Fix web order data"/>
| <transition g="-31,-24" name="Order ok" to="Processing Fork"/>
| </task>
|
| <task form="tasks/form.fix.xhtml" g="204,300,169,43" name="Fix web order data" swimlane="Buyer">
| <transition g="363,246:-62,-2" name="More info added" to="Evaluate web order"/>
| </task>
|
| <fork g="432,126,48,48" name="Processing Fork">
| <transition g="457,78:-83,-22" name="Process payment" to="Wait for money"/>
| <transition g="457,220:-67,4" name="Process shipping" to="Ship item"/>
| </fork>
|
| <task form="tasks/form.money.xhtml" g="509,38,116,80" name="Wait for money" swimlane="Finantial Department">
| <transition g="-42,-24" name="Update stock" to="Update books"/>
| </task>
|
| <state g="615,180,100,80" name="Ship item">
| <transition g="862,221:-136,-23" name="Items sent" to="Processing Join"/>
| </state>
|
| <join g="839,126,48,48" name="Processing Join">
| <transition g="-39,-31" name="Close order" to="Web sale processed"/>
| </join>
|
| <end g="949,126,48,48" name="Web sale processed" state="completed"/>
|
| <state g="714,39,117,78" name="Update books">
| <transition g="862,76:-30,-26" name="Stock updated" to="Processing Join"/>
| </state>
|
| </process>
|
And here the test case that force the error:
| public class EndProcessInstanceTest extends JbpmTestCase {
| // Process deployment id
| String deploymentId;
|
| // Identities
| String salesDept;
| String finantialDept;
| String logisticDept;
| String clients;
|
| String processInstanceId;
| String processDefinitionId;
|
| // Mail server
| Wiser wiser = new Wiser();
|
| protected void setUp() throws Exception {
| super.setUp();
|
| // create identities
| salesDept = identityService.createGroup("sales");
| finantialDept = identityService.createGroup("finantial");
| logisticDept = identityService.createGroup("logistic");
| clients = identityService.createGroup("clients");
|
| identityService.createUser("john", "John", "Doe", "john@doe");
| identityService.createMembership("john", salesDept, "manager");
|
| identityService.createUser("joe", "Joe", "Smoe", "joe@smoe");
| identityService.createMembership("joe", salesDept, "sales-repre");
|
| identityService.createUser("jim", "Jim", "Cue", "jim@cue");
| identityService.createMembership("jim", finantialDept, "employee");
|
| identityService.createUser("luci", "Luci", "Lee", "luci@lee");
| identityService.createMembership("luci", logisticDept, "employee");
|
| identityService.createUser("rex", "Rex", "Frez", "rex@frez");
| identityService.createMembership("rex", clients, "client");
|
| // deploy process
| deploymentId = repositoryService.createDeployment()
| .addResourceFromClasspath("jboss-test-websale.jpdl.xml")
| .deploy();
|
| // the tearDown of the parent class will dispose the registered deployments
| registerDeployment(deploymentId);
|
| processDefinitionId = repositoryService.createProcessDefinitionQuery().
| deploymentId(deploymentId).uniqueResult().getId();
|
| // start mail server
| wiser.setPort(2525);
| wiser.start();
| }
|
| protected void tearDown() throws Exception {
| // stop mail server
| wiser.stop();
|
| // delete identities
| identityService.deleteUser("john");
| identityService.deleteUser("joe");
| identityService.deleteUser("jim");
| identityService.deleteUser("luci");
|
| identityService.deleteUser("rex");
|
| identityService.deleteGroup(salesDept);
| identityService.deleteGroup(finantialDept);
| identityService.deleteGroup(logisticDept);
| identityService.deleteGroup(clients);
|
| super.tearDown();
| }
|
| /**
| * Start a new process instance and force the instance end
| *
| * - One task and one Job will be created at process startup
| *
| * @throws Throwable
| */
| public void testEndInstance() throws Throwable {
| // Prepare start variables and start new process instance
| startProcess();
|
| // Force the process instance end with a "cancelled" state
| executionService.endProcessInstance(processInstanceId, "cancelled");
|
| assertProcessInstanceEnded(processDefinitionId);
|
| // Looking for the jobs for the given instance
| List<Job> jobs = managementService.createJobQuery()
| .processInstanceId(processInstanceId)
| .list();
|
| // No jobs should exists
| assertEquals("Unexpected number of jobs", 0, jobs.size());
|
| // No group tasks should exists for "joe"
| List<Task> taskList = taskService.findGroupTasks("joe");
| assertEquals("Expected a single task in joe's task list", 0, taskList.size());
| }
|
| private void startProcess() throws Throwable {
| ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).uniqueResult();
|
| // Prepare process variables
| Map<String, Object> orderData = new Hashtable<String, Object>();
| orderData.put("buyer", "rex"); // Used by the "Buyer" Swimlane.
|
| // Starting a process instance with variables
| ProcessInstance instance = executionService.startProcessInstanceByKey("Test_Websale", orderData);
| processInstanceId = instance.getId();
|
| // Looking for the jobs for the given instance
| List<Job> jobs = managementService.createJobQuery()
| .processInstanceId(processInstanceId)
| .list();
|
| // One job must be started at the first activity
| assertEquals("Unexpected number of jobs", 1, jobs.size());
|
| // A group task must be created for swimlane "Sales Representatives", where joe belongs to
| // Cheking the group task for joe
| List<Task> taskList = taskService.findGroupTasks("joe");
| assertEquals("Expected a single task in joe's task list", 1, taskList.size());
| }
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265967#4265967
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265967
16 years, 4 months
[jBPM Users] - Re: Jbpm 4.2 how to enable variable history
by sebastian.s
"xalperte" wrote :
| Buff, I'm looking inside the HistoryVariableImpl class and it only maintains a String representation of the original variable value, its not enough, to be functional the HistoryVariableImpl should maintain the exact value and type of the original variable.
|
| I think the better approach is not delete the process instances when they are ended, and extends the ProcessInstanceQuery with the ended flag. This could be a short term solution. Why do you deletes the instances when it were ended? because the performance? the number of records in the tables?
|
To answer one of your questions:
I think ended process instances are stored inside a seperate table because the tables used during runtime tend to get really big. If I recall it correctly this was the reason.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265949#4265949
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265949
16 years, 4 months