[JBoss JIRA] Created: (JBPM-2553) Violation of unique constratin with two splits
by David Loiseau (JIRA)
Violation of unique constratin with two splits
----------------------------------------------
Key: JBPM-2553
URL: https://jira.jboss.org/jira/browse/JBPM-2553
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.1
Reporter: David Loiseau
Thow split steps with two identical transition names cause a violation of unique constraint in JBPM4_EXECUTION table.
Process Definition:
<?xml version="1.0" encoding="UTF-8"?>
<process key="test" name="test" xmlns="http://jbpm.org/4.0/jpdl">
<start g="82,38,41,27" name="start1">
<transition g="-43,-18" name="to fork1" to="fork1"/>
</start>
<fork g="79,112,25,20" name="fork1">
<transition name="to task1" to="task1" g="-44,-18"/>
<transition name="to task2" to="task2" g="-44,-18"/>
</fork>
<fork g="88,263,65,27" name="fork2">
<transition name="to task1" to="task4" g="-44,-18"/>
<transition name="to task3" to="task3" g="-44,-18"/>
</fork>
<task assignee="test" name="task1" g="75,189,60,42">
<transition name="to fork2" to="fork2" g="-43,-18"/>
</task>
<task name="task2" g="163,117,61,31"/>
<task name="task3" g="189,268,59,37"/>
<task name="task4" g="93,340,52,40"/>
</process>
Test code:
ProcessEngine processEngine = Configuration.getProcessEngine();
RepositoryService repositoryService = (RepositoryService) processEngine.get(RepositoryService.class);
String deploymentId = repositoryService
.createDeployment()
.addResourceFromClasspath("test.jpdl.xml")
.deploy();
Execution execution = processEngine.getExecutionService().startProcessInstanceByKey("test");
Task task = (Task)processEngine.getTaskService().findPersonalTasks("test").get(0);
processEngine.getTaskService().completeTask(task.getId(),"to fork2");
Exception:
Caused by: java.sql.SQLException: Violation of unique constraint $$: duplicate value(s) for column(s) $$: SYS_CT_970 in statement [update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
... 39 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[JBoss JIRA] Created: (JBPM-2614) TimerSessionBinding does not allow 3rd party TimerSession implementations
by sdfsd sdfsd (JIRA)
TimerSessionBinding does not allow 3rd party TimerSession implementations
-------------------------------------------------------------------------
Key: JBPM-2614
URL: https://jira.jboss.org/jira/browse/JBPM-2614
Project: jBPM
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.x
Reporter: sdfsd sdfsd
We want to use our own scheduler for Timers but even if the infrastracture is in place one can not configure it's own implementation of TimerSession.
The <timer-session/> element allows only target ='ejb' and nothing else will be parsed by the method TimerSessionBinding.parse(). I can't understand why can't I provide my own implementation of TimerSession.
the Solution would be to change add and attribute className to <timer-session/> element and to change the TimerSessionBinding.parse() method like this :
objectDescriptor.setClassName(XmlUtil.attribute(element, "class"));
you can also add a target like 'custom' and only then check the 'class' attribute. Something like this:
public Object parse(Element element, Parse parse, Parser parser) {
ObjectDescriptor objectDescriptor = new ObjectDescriptor();
String target = XmlUtil.attribute(element, "target");
if ((target!=null){
if ("ejb".equalsIgnoreCase(target))) {
objectDescriptor.setClassName("org.jbpm.enterprise.internal.ejb.EnterpriseTimerSession");
}
else if ("custom".equalsIgnoreCase(target))) {
objectDescriptor.setClassName(XmlUtil.attribute(element, "class"));
}
} else {
// wire the JobExecutorTimerSession
objectDescriptor.setClassName(JobExecutorTimerSession.class.getName());
// inject fields
objectDescriptor.addInjection("transaction", new TransactionRefDescriptor());
objectDescriptor.addInjection("jobExecutor", new EnvDescriptor(JobExecutor.class));
objectDescriptor.addInjection("session", new ContextTypeRefDescriptor(Session.class));
}
return objectDescriptor;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[JBoss JIRA] Created: (JBPM-2535) Exception during async execution causes multiple instances of the same task being inserted to the database
by Peter Horvath (JIRA)
Exception during async execution causes multiple instances of the same task being inserted to the database
----------------------------------------------------------------------------------------------------------
Key: JBPM-2535
URL: https://jira.jboss.org/jira/browse/JBPM-2535
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.x
Reporter: Peter Horvath
If a task is reached in an asynchronous execution and notification email sending (or any automated activity)
throws and exception new task instances are inserted to the database on every retry of the asynchronous job.
ExecuteJobCmd creates a JobExceptionHandler to re-try the execution of the job.
Since org.jbpm.jpdl.internal.activity.TaskActivity.execute() method is called on every retry,
and this method creates a new task instance each time it is called, multiple instances of the
same task with the same execution id will be inserted to the database.
All operations that try to query the task by execution will fail due to a NonUniqueResultException.
Example process definition: (note continue="async" attribute on start tag)
<?xml version="1.0" encoding="UTF-8"?>
<process name="task_error" xmlns="http://jbpm.org/4.0/jpdl">
<start name="start1" g="93,78,48,48" continue="async">
<transition name="to Test Task" to="Test Task" g="1,-20"/>
</start>
<end name="end1" g="315,236,48,48"/>
<task name="Test Task" g="178,159,92,52" assignee="johnsmith">
<notification>
<to users="${task.assignee}"/>
<cc addresses="invalid@email@address"/>
<subject>${task.name}</subject>
<text>
<![CDATA[Hi ${task.assignee},
Task "${task.name}" has been assigned to you.
${task.description}
Sent by JBoss jBPM
]]>
</text>
</notification>
<transition name="to end1" to="end1" g="-6,-22"/>
</task>
</process>
The notification email will fail (email sender throws an exception) because of the invalid email address (invalid@email@address) that is set in CC tag.
First run fails because of this invalid email address:
SEVERE: exception while executing 'ExecuteActivityMessage[25]'
org.jbpm.api.JbpmException: failed to add invalid@email@address to recipients of type Cc
at org.jbpm.pvm.internal.email.impl.MailProducerImpl.fillRecipients(MailProducerImpl.java:197)
at org.jbpm.pvm.internal.email.impl.MailProducerImpl.fillRecipients(MailProducerImpl.java:180)
at org.jbpm.pvm.internal.email.impl.MailProducerImpl.produce(MailProducerImpl.java:79)
at org.jbpm.jpdl.internal.activity.MailListener.notify(MailListener.java:56)
at org.jbpm.pvm.internal.model.op.ExecuteEventListener.perform(ExecuteEventListener.java:81)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
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)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_4.performAtomicOperationSync(ExecutionImpl_$$_javassist_4.java)
at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.execute(ExecuteActivityMessage.java:46)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:74)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:79)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.jobexecutor.JobExecutorThread.run(JobExecutorThread.java:63)
Caused by: javax.mail.internet.AddressException: Illegal character in domain in string ``invalid@email@address''
at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:947)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:833)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:569)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:546)
at org.jbpm.pvm.internal.email.impl.MailProducerImpl.fillRecipients(MailProducerImpl.java:194)
... 21 more
First retry fails since there are two tasks with the same execution id in the database (query returns 2 results):
SEVERE: exception while executing 'ExecuteActivityMessage[25]'
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:382)
at org.jbpm.jpdl.internal.activity.MailListener.notify(MailListener.java:50)
at org.jbpm.pvm.internal.model.op.ExecuteEventListener.perform(ExecuteEventListener.java:81)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
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)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_4.performAtomicOperationSync(ExecutionImpl_$$_javassist_4.java)
at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.execute(ExecuteActivityMessage.java:46)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:74)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:79)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.jobexecutor.JobExecutorThread.run(JobExecutorThread.java:63)
Second retry fails since there are three tasks with the same execution id in the database (query returns 3 results):
SEVERE: exception while executing 'ExecuteActivityMessage[25]'
org.hibernate.NonUniqueResultException: query did not return a unique result: 3
at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:382)
at org.jbpm.jpdl.internal.activity.MailListener.notify(MailListener.java:50)
at org.jbpm.pvm.internal.model.op.ExecuteEventListener.perform(ExecuteEventListener.java:81)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
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)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_4.performAtomicOperationSync(ExecutionImpl_$$_javassist_4.java)
at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.execute(ExecuteActivityMessage.java:46)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:74)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:79)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.jobexecutor.JobExecutorThread.run(JobExecutorThread.java:63)
I believe org.jbpm.jpdl.internal.activity.TaskActivity.execute() method should be modified to try to look up the task instance first and create a new instance only if there is no existing one in the database:
public void execute(ExecutionImpl execution) {
DbSession dbSession = Environment.getFromCurrent(DbSession.class);
TaskImpl task = dbSession.findTaskByExecution(execution);
if(task == null) {
task = (TaskImpl) dbSession.createTask();
task.setTaskDefinition(taskDefinition);
task.setExecution(execution);
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[JBoss JIRA] Created: (JBPM-2583) IdentityService createGroup creates duplicate groups
by Robert Moskal (JIRA)
IdentityService createGroup creates duplicate groups
----------------------------------------------------
Key: JBPM-2583
URL: https://jira.jboss.org/jira/browse/JBPM-2583
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.1
Environment: JDK 1.6, mysql 5
Reporter: Robert Moskal
Repeatedly calling createGroup with the same group name causes very similar records to be entered into the JBPM_ID_GROUP table. They differ only bythe DBID_ field value. Here is an example of what I found in the database.
17 0 another another (null) (null)
18 0 another another (null) (null)
19 0 another another (null) (null)
20 0 another another (null) (null)
21 0 another another (null) (null)
Retrievals don't result in duplicates, but this seems like it might cause problems.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[JBoss JIRA] Created: (JBPM-1164) Null Pointer Exception is thrown when subprocess is leave event is fired.
by Gurpreet Sahota (JIRA)
Null Pointer Exception is thrown when subprocess is leave event is fired.
-------------------------------------------------------------------------
Key: JBPM-1164
URL: http://jira.jboss.com/jira/browse/JBPM-1164
Project: JBoss jBPM
Issue Type: Bug
Affects Versions: jBPM jPDL 3.2.2
Environment: Windows XP Pro, Sun JDK 1.5.0_13
Reporter: Gurpreet Sahota
Assigned To: Tom Baeyens
I have a process flow where process (A) calls a process state that in turn calls subprocess (B). When Subprocess "end" state is signalled then I receive a Null Pointer Exception.
Following is stack trace
java.lang.NullPointerException
at org.jbpm.graph.node.ProcessState.leave(ProcessState.java:204)
at org.jbpm.graph.exe.Token.signal(Token.java:195)
at org.jbpm.graph.exe.Token.signal(Token.java:140)
When debugging, it turns out that "leave" method in ProcessState tries to retrieve subProcessInstance from execution context. This is set to null causing exception. If executionContext.getToken() is used to retrieve the subProcessInstance, then it is not null.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months