[JBoss jBPM] - bject references an unsaved transient instance - save the tr
by rodosa
Hello, I've a problem in a method that advance in a definition process for the indicated transition. The method is the following:
| private void goTo(Long id_instance, String transition) {
| try {
| ProcessInstance instance=getJbpmContext().loadProcessInstanceForUpdate(id_instance);
| if(!instance.isTerminatedImplicitly()){
| Token token=new Token(instance);
| token.signal(transition);
|
| jbpmContext.save(token);
| jbpmContext.save(instance);
| }
| } catch (RuntimeException e) {
| e.printStackTrace();
| }finally{
| jbpmContext.close();
| }
| }
|
And the exception is.
| 12:40:42,078 ERROR [DbPersistenceService] hibernate commit failed
| org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.graph.exe.Token
| at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
| at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
| at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
| at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:597)
| at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3123)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:479)
| at
| ....
|
How could do I fix it?? Because I save both, token and instance. I tried only to save the instance but it didn't work.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201715#4201715
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201715
17 years, 2 months
[JBoss jBPM] - jBPM 4 start parameters
by modchen
My goal is to run java code in a process with some given start parameters
After some research I found this in the userguide :
anonymous wrote : 4.3.4. With variables
|
| A map of named parameter objects can be provided when starting a new process instance. These parameters will be set as variables on the process instance between creation and start of the process instance.
|
| ...
|
| executionService.startExecutionByKey("MyProcess", variables);
|
|
This is the part in my process.jpdl.xml :
<java name="executeMyCode"
| class="org.jbpm.examples.java.MyClass"
| method="doSomething"
| var="response"
| g="96,16,127,52">
|
| <arg>####</arg>
|
| <flow to="goToNextStep" />
| </java>
|
What do I have to replace #### with, to get this working ? Or isn't this possible ? Looking the other examples, it should be something like "#{myvar}"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201714#4201714
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201714
17 years, 2 months