[jboss-user] [JBoss jBPM] - org.hibernate.TransientObjectException object references an

javi0704 do-not-reply at jboss.com
Thu May 17 07:37:42 EDT 2007


Hello,

I've just started using JBPM and I'm trying to create new State between 2 task-nodes.At the beginning the processDefinition look like this:
1) start-state-->task-node1-->task-node2-->end-state
but i would like to create a new State to Runtime when between this 2 task-nodes violation occur. So my ProcessDefinition have then a new State like this:
2)start-state-->task-node1-->newstate-->task-node2-->end-state

When I try to run the process, I get the following exception. Can anyone help please? My code looks like this:
==========================
Node currentNode = executionContext.getNode();
System.out.println("!!!----WhoIsCurrentNode: " + currentNode.toString());
Transition oldTrans = currentNode.getDefaultLeavingTransition();#to next1
Node nextNode = oldTrans.getTo();
System.out.println("!!!---WhoIsnexttNode1: " +nextNode.toString());
State stateNode = new State("WaitState"); //create me new stateNode
Transition stateTrans = new Transition();
currentNode.addLeavingTransition(oldTrans); 
oldTrans.setFrom(currentNode);
oldTrans.setTo(stateNode);
stateNode.addArrivingTransition(oldTrans);  
stateNode.addLeavingTransition(stateTrans);	    
nextNode.addArrivingTransition(stateTrans);	 
stateTrans.setFrom(stateNode);
stateTrans.setTo(nextNode);

When I try to run the process, I get the following exception. Can anyone help please? using server (jbpm-starters-kit-3.1.3)
=================================
13:19:23,593 DEBUG [CommandExecutorThread] waiting for more messages
13:19:23,593 DEBUG [StaticNotifier] going to wait for (CMD_EXECUTOR, java.lang.O
bject at 1bdcbb2)
13:19:23,593 DEBUG [DbPersistenceServiceFactory] creating persistence service
13:19:23,593 DEBUG [DbPersistenceService] creating hibernate session
13:19:23,593 DEBUG [DbPersistenceService] beginning hibernate transaction
13:19:23,593 DEBUG [SchedulerThread] checking for timers
13:19:23,593 DEBUG [JbpmContext] closing JbpmContext
13:19:23,593 DEBUG [Services] closing service 'persistence': org.jbpm.persistenc
e.db.DbPersistenceService at 4e1a93
13:19:23,593 DEBUG [DbPersistenceService] committing hibernate transaction
13:19:23,593 DEBUG [DbPersistenceService] closing hibernate session
13:19:23,734 INFO  [STDOUT] ci.getVariable("Number "): '1'
13:19:23,734 INFO  [STDOUT] !!!----WhoIsCurrentNode: TaskNode(form)
13:19:23,734 INFO  [STDOUT] !!!----WhoIsnexttNode1: TaskNode(After-form)
13:19:23,734 INFO  [STDOUT] !!!T----WhoIsnexttNode2: State(WaitStateNode)
13:19:23,734 INFO  [STDOUT] ================================================
13:19:23,734 INFO  [STDOUT] ================================================
13:19:23,734 DEBUG [GraphElement] event 'transition' on 'Transition(to next1)' f
or 'Token(/)'
13:19:23,734 DEBUG [GraphElement] event 'node-enter' on 'State(WaitStateNode)'
for 'Token(/)'
13:19:23,734 DEBUG [GraphElement] event 'after-signal' on 'TaskNode(form)' for 'Token(/)'
13:19:23,734 DEBUG [TaskBean] assignmentlogs: []
13:19:23,734 DEBUG [Services] executing default save operations
13:19:23,734 DEBUG [HibernateSaveOperation] saving process instance
13:19:23,734 DEBUG [SaveLogsOperation] flushing logs to logging service.
13:19:23,750 DEBUG [CascadeSaveOperation] cascading save of 'org.jbpm.graph.exe.
ProcessInstance at 19bc401'
13:19:23,750 INFO  [[/jbpm]] WARNING: Component _id13 just got an automatic id,
because there was no id assigned yet. If this component was created dynamically
(i.e. not by a JSP tag) you should assign it an explicit static id or assign it
the id you get from the createUniqueId from the current UIViewRoot component rig
ht after creation!
13:19:23,750 ERROR [TaskMgmtSession] org.hibernate.TransientObjectException: obj
ect references an unsaved transient instance - save the transient instance befor
e flushing: org.jbpm.graph.node.State
13:19:23,750 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.faces.el.EvaluationException: Cannot get value for expression '#{homeBean.
taskInstances}'
        at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java
:399)
        at javax.faces.component.UIData.getValue(UIData.java:779)
        at javax.faces.component.UIData.createDataModel(UIData.java:545)
        at javax.faces.component.UIData.getDataModel(UIData.java:534)
        at javax.faces.component.UIData.getRowCount(UIData.java:103)
        at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeInnerHt
ml(HtmlTableRendererBase.java:124)
        at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeChildre
n(HtmlTableRendererBase.java:94)

		

Thank you,


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046453#4046453

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046453



More information about the jboss-user mailing list