[jboss-user] [JBoss Seam] - Re: Problem with JBPM nodes and transitions

chawax do-not-reply at jboss.com
Mon Sep 3 11:56:36 EDT 2007


I have another problem with transitions. I have a task-node with 2 transitions "Accepter" and "Refuser". These transitions can be fired from two command buttons in a JSF. These transitions go to nodes with Seam actions binded to them. But when JBPM calls these actions, the processInstance I get with the @In annotation is null ... Why is this processInstance null ?

Here is my JSF :

<h:dataTable value="#{taskInstanceList}" var="task" rendered="#{not empty taskInstanceList}">
  | 	<h:column>
  | 		<f:facet name="header">
  | 		<h:outputText value="Description"/>
  | 		</f:facet>
  | 		<h:outputText value="#{task.description}"/>
  | 	</h:column>
  | 	<h:column>
  | 		<f:facet name="header">
  | 			<h:outputText value="Effectuée le"/>
  | 		</f:facet>
  | 		<h:outputText value="#{task.taskMgmtInstance.processInstance.start}">
  | 			<f:convertDateTime type="date"/>
  | 		</h:outputText>
  | 	</h:column>
  | 	<h:column>
  | 		<s:button value="Accepter" action="#{afficherMessageConsole.accepterDemande}" taskInstance="#{task}" />
  | 		<s:button value="Refuser" action="#{afficherMessageConsole.refuserDemande}" taskInstance="#{task}" />
  | 	</h:column>
  | </h:dataTable>

Here is my Java class :

public class AfficherMessageConsole {
  | 
  | 	@In
  | 	private ProcessInstance processInstance;
  | 
  | 	@StartTask
  | 	@EndTask (transition="Accepter")
  | 	public String accepterDemande() throws Exception {
  | 		return "validationDemandes";
  | 	}
  | 	
  | 	@StartTask
  | 	@EndTask (transition="Refuser")
  | 	public String refuserDemande() throws Exception {
  | 		return "validationDemandes";
  | 	}
  | 
  | 	public void demandeAcceptee() throws Exception {
  | 		log("Demande acceptee !");
  | 		processInstance.getRootToken().signal();
  | 	}
  | 	
  | 	public void demandeRefusee() throws Exception {
  | 		log("Demande refusee !");
  | 		processInstance.getRootToken().signal();
  | 	}
  | }

And finally a part of the JPDL :

<task-node name="Avis de la RH">
  | 	<task name="Validation de la RH">
  | 		<assignment actor-id="#{actor.id}" />
  | 	</task>
  | 	<transition name="Refuser" to="Refus"></transition>
  | 	<transition name="Accepter" to="Acceptation"></transition>
  | </task-node>
  | <node name="Refus">
  | 	<action expression="#{afficherMessageConsole.demandeRefusee}" />
  |       <transition name="" to="End"></transition>
  | </node>
  | <node name="Acceptation">
  | 	<transition to="End" />
  | 	<action expression="#{afficherMessageConsole.demandeAcceptee}" />
  | </node>
  | <end-state name="End"></end-state>
  | 

I looked for samples in the source code, but there are no examples with nodes (and it's a shame). I'm not sure I understood well how to integrate Seam and JBPM, so feel free to tell me if I do something wrong !

Thanks in advance ;)

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

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




More information about the jboss-user mailing list