-
1. Re: Problem with JBPM nodes and transitions
pmuir Sep 3, 2007 6:40 AM (in response to chawax)The JavaDoc for @Transition states
Allows the application to set the jBPM transition to be used when an <tt>@EndTask</tt> method is encountered.
So, nothing to do with transitions between nodes when tasks aren't involved. -
2. Re: Problem with JBPM nodes and transitions
chawax Sep 3, 2007 7:51 AM (in response to chawax)Well it's strange because transition from Node1 to Node2 works well with @Transition ... Anyway, how can I do to fire a transition from an action (method of a Seam component) ?
-
3. Re: Problem with JBPM nodes and transitions
chawax Sep 3, 2007 8:09 AM (in response to chawax)To be more precise ...
When I used JBPM without seam, I had to write these lines in my action handlers so that the process continues :public void execute(ExecutionContext context) throws Exception { context.leaveNode(); }
What should I do with Seam to make it work the same ? -
4. Re: Problem with JBPM nodes and transitions
chawax Sep 3, 2007 8:58 AM (in response to chawax)I found a solution on another post on this forum. I inject processInstance then I can call processInstance.getRootToken().signal() and it works.
Something like that :public class AfficherMessageConsole { @In private org.jbpm.graph.exe.ProcessInstance processInstance; public void goToNode2() throws Exception { execute("GO TO NODE 2"); processInstance.getRootToken().signal(); } }
Is it the good way to do it or there is a nicer solution ? -
5. Re: Problem with JBPM nodes and transitions
chawax Sep 3, 2007 11:56 AM (in response to chawax)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 ;) -
6. Re: Problem with JBPM nodes and transitions
chawax Sep 4, 2007 5:27 AM (in response to chawax)Anyone could help me ? I really can't understand what happens :(
I work with Seam 1.1.6, JBPM 3.1.4 and JBoss 4.0.5 GA