[jboss-user] [JBoss jBPM] - Re: Combo Box in Form

karstendausb do-not-reply at jboss.com
Wed Sep 5 10:23:32 EDT 2007


Hi Ronald,

"kukeltje" wrote : 
  | hmmm... I read your post and do not see where jBPM is involved in a way that it is causing this problem. Everything you describe is JSF, the only thing is that you put selectItems in a variable, but that is just like you would do in in a bean. 
  | 

I am pretty sure that the problem is caused by the jbpm persistence layer, see below. JSF just compares by instanceof, that is a standard procedure and should be fine anyway.

anonymous wrote : 
  | Yet, I do not disagree that a nicer solution would be 'handy' and seam provides parts of that for you. what you encounter now is in the grey area of the webconsole. What is it intended for? Production systems? well, the management part should be. Is it intended for end-users? No currently not. So some things are not in there and personally I use the storage of variables only in the RAD/Prototype part of a project. For productionsystems we have a separate domain model and use a separate database for that (with separate ui) so the list of selectitems comes from there and not jBPM. The selected value goes into jBPM.
  | 

Thanks a lot, I haven't seen that so clear so far. I should reconsider my approach here.

anonymous wrote : 
  | And yes, I will investigate since it would indeed be nice if the webconsole supported this out of the box in a fairly easy way. Care to help and build a nice more complex example of a ui with this in there?
  | 

Provide an example usage  of how to feed task forms? Yes, I can do that.

First I would like to show that this problem is most probably  JSF-unrelated:
The following process definition runs fine when using it with a junit test and _without_ persistence. All instanceof comparisons return true.

  | <?xml version="1.0" encoding="UTF-8"?>
  | <process-definition 
  | 	  xmlns="urn:jbpm.org:jpdl-3.2"
  | 	  name="A_SelectItemsTest">
  | 	   <start-state name="start">
  | 	      <transition name="to_state" to="first">
  | 	      </transition>
  | 	   </start-state>
  | 	   <state name="first">
  | 	   	      <event type="node-enter">
  | 	   	      <script>
  | 	         	List test=new LinkedList();
  | 	         	javax.faces.model.SelectItem si=new  javax.faces.model.SelectItem("hallo","test");
  | 	         	test.add(si);
  | 	         	executionContext.getContextInstance().setVariable("selectitems", test);
  | 	         	System.out.println("first.node-enter: directly after setting variable: instanceof selectitem:"+(test.get(0) instanceof javax.faces.model.SelectItem));
  | 	         	System.out.println("item "+test.get(0)+" is "+test.get(0).getClass().getName());
  | 	         	
  | 	      	 </script>
  | 	      	 </event>
  | 	      	 <event type="node-leave">
  | 	      	 <script>
  | 	         	List l1=executionContext.getContextInstance().getVariable("selectitems");
  | 	         	System.out.println("first.node-leave: instanceof selectitem:"+(l1.get(0) instanceof javax.faces.model.SelectItem));
  | 	         	System.out.println("item "+l1.get(0)+" is "+l1.get(0).getClass().getName());
  | 	      	 </script>
  | 	      	 </event>
  | 	      <transition name="to_second" to="second">
  | 	      </transition>
  | 	   </state>
  | 	   <state name="second">
  | 	   	      <event type="node-enter">
  | 	   	      <script>
  | 	         	List l2=executionContext.getContextInstance().getVariable("selectitems");
  | 	         	System.out.println("second.node-enter: instanceof selectitem:"+(l2.get(0) instanceof javax.faces.model.SelectItem));
  | 	         	System.out.println("item "+l2.get(0)+" is "+l2.get(0).getClass().getName());
  | 	      	 </script>
  | 	      	 </event>
  | 	      <transition name="to_end" to="end">
  | 	      </transition>
  | 	   </state>
  | 	   <end-state name="end"></end-state>
  | 	</process-definition>

But...when deploying it to jbpm and running it in the console - without the use of any jsf-task-forms!!! - the first instanceof-comparison returns true, but the second and third do not:

  | 16:08:41,752 INFO  [STDOUT] first.node-enter: directly after setting variable: instanceof selectitem:true
  | 16:08:41,770 INFO  [STDOUT] item javax.faces.model.SelectItem at f3a37f is javax.faces.model.SelectItem
  | 
  | 16:09:29,251 INFO  [STDOUT] first.node-leave: instanceof selectitem:false
  | 16:09:29,253 INFO  [STDOUT] item javax.faces.model.SelectItem at b52821 is javax.faces.model.SelectItem
  | 
  | 16:09:29,315 INFO  [STDOUT] second.node-enter: instanceof selectitem:false
  | 16:09:29,317 INFO  [STDOUT] item javax.faces.model.SelectItem at b52821 is javax.faces.model.SelectItem
  | 

Again...I am neither an jbpm nor an hibernate expert, so I cannot say what is going wrong here.  But the problem only occurs if the process variable is persisted. 
Maybe all the people  in this forum facing this problem  have a faulty  jbpm setup (database e.g.)?

Where to look next? Any ideas? 

Karsten

btw: @Ronald: Thanks for your effort, you have definetely helped a lot of people in this forum!


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

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



More information about the jboss-user mailing list