[JBoss jBPM] - Clarification
by elifarley
Let me clarify the last post with an imaginary use case (close to the real one).
A node in my workflow loads a text file describing stages through which an order request must pass in order to be approved:
--
actor-A, actor-B;
actor-C, actor-D, actor-E;
actor-F;
--
Each order request has its associated text file (otherwise I could simply design a fixed workflow with the appropriate task nodes).
For each line, a task should be assigned to the group of actors listed on that line.
I tried to parse the text file and create a transient, dynamic process definition based on it, so that I could persist it, call it using a process-state node, and then purge it from the database - all from the same master process.
Unfortunately, it doesn't seem to work like that.
I'll try to create this transient process definition and post a JMS message to be later processed. At least it sounds more promising...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208751#4208751
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208751
15 years, 5 months
Context Variable Mappings
by Andrew Norman
I am trying to get a non serialisable object to be stored in the context
of a workflow process.
I have updated the jbpm.cfg.xml file to point to my modiffed varmapping
file, I then added the following XML snippet into jbpm.varmapping.xml
file.
<jbpm-type>
<matcher>
<bean class="com.erudine.MyMatcher" />
</matcher>
<converter class="com.erudine.MyConvertor" />
<variable-instance
class="org.jbpm.context.exe.variableinstance.StringInstance" />
</jbpm-type>
I have written a Junit test case to verify that the number of types
returned by the call JbpmType.getJbpmTypes() matches the number the is
declared in the modified mapping file.
MyMatcher class just contains a "return obj instanceof MyClass" in it
and the convertor object just returns a constant test string as the
conversion to and from the database.
If I step through the list of the JbpmTypes from the object factory
calling match() with an instant of MyClass I get a null pointer from the
JbpmType that I think corresponds to the one I have written.
If I run a workflow ProcessInstance containing an action handler that
attempts to store an instance of MyClass I get an hibernate exception
complaining that I was attempting to put a non persistent variable into
a persistent store.
Any suggestions would be helpful, I am at my wits end trying to get this
fixed ... I expect I have missed a simple step somewhere.
___________________________
Andrew Norman
Developer
www.erudine.com <http://www.erudine.com/>
T: +44 (0) 1423 522 336
M: +44 (0) 7824 310 089
This email and any files transmitted with it are confidential and solely
for the use of the intended recipient. If you receive this email in
error, then please inform the sender and delete it from your inbox.
Although this email has been checked for all known viruses, it is
recommended that recipients undertake their own virus checking as
Erudine will not accept any liability for any damage caused. Finally,
any opinions expressed in this email are those of the individual and do
not necessarily reflect the views of Erudine as a company.
Erudine is a trading name of Remote Operations Ltd. and is registered in
England and Wales with No.04280731. Registered Office: Kent House,
Church Street, Gateshead, NE8 2AT.
15 years, 5 months
[JBoss jBPM] - Jbpm 3.3.1 Timer Exception on executionContext.leaveNode()
by dleerob
Hi,
In Jbpm 3.2.x, I never had this problem. But I recently upgraded to Jbpm 3.3.1, and now, on a State Node, if I have a timer set which repeats, and on the timers action I call executionContext.leaveNode(), I get an exception. If my timer is not set to repeat, I don't get the exception. This is a bit of a showstopper for me. Any ideas would be appreciated?
Here is my simple process definition:
<process-definition
| xmlns="urn:jbpm.org:jpdl-3.2" name="ITD Sick Leave">
| <swimlane name="Initiator"></swimlane>
| <start-state name="Record Sick Leave">
| <transition to="Wait for Tomorrow"></transition>
| </start-state>
|
|
| <state name="Wait for Tomorrow">
| <timer duedate="5 seconds" name="Wait for Tomorrow" repeat="5 seconds">
| <action class="za.co.workflow.itdsickleave.action.WaitForTomorrow"></action>
| </timer>
| <transition to="Complete"></transition>
| </state>
|
|
| <end-state name="Complete"></end-state>
| </process-definition>
Here is my action's execute method attached to the timer:
public void handle(ExecutionContext executionContext) throws Exception {
| executionContext.leaveNode();
| }
Here is the exception being thrown:
INFO JbpmJobExecutor:10.11.5.61:1 org.jbpm.persistence.db.DbPersistenceService - problem committing transaction: optimistic locking failed
| INFO JbpmJobExecutor:10.11.5.61:1 org.jbpm.svc.Services - problem closing service 'persistence': optimistic locking failed
| ERROR JbpmJobExecutor:10.11.5.61:1 org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
| org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.job.Timer#2480]
| at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765)
| at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2407)
| at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
| at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
| at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:266)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:222)
| at org.jbpm.svc.Services.close(Services.java:294)
| at org.jbpm.JbpmContext.close(JbpmContext.java:136)
| at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:190)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208614#4208614
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208614
15 years, 5 months