-
1. Re: decision expression
antitrust1982 Mar 6, 2006 11:11 AM (in response to antitrust1982)I have just seen in an another topic the same problem but i don't understand really what i must do. can you help me to understand well please
thanks for your help
antitrust1982
http://jboss.org/index.html?module=bb&op=viewtopic&t=66796 -
2. Re: decision expression
aguizar Mar 6, 2006 6:11 PM (in response to antitrust1982)Looks like you intend the actor of the Analyse DA task to make the decision. In this case you would have multiple outgoing transitions from the task node, query the available transitions with TaskInstance.getAvailableTransitions() and complete the task and leave over one transition with TaskInstance.end(transition).
-
3. Re: decision expression
antitrust1982 Mar 7, 2006 4:06 AM (in response to antitrust1982)ok thank you for all. I will try your solution on my application.
Antitrust1982 -
4. Re: decision expression
antitrust1982 Mar 7, 2006 10:18 AM (in response to antitrust1982)hi,
i had tried your solution but when i put expression in decision node in my xpdl file the workflow already goes in the default branch and if i don't put any expression in decision node the file is block in the node. i join my xpld file and my file of exploration if you see any errors can you help me to understand how works this workflow because i'm a beginner in this domain and it's difficult to understand how works this technologie. thx tou for your help
the JAVA FILE: (JUnit)package com.testjbpm; import org.jbpm.graph.def.*; import org.jbpm.graph.exe.*; import org.jbpm.jpdl.xml.*; import org.jbpm.taskmgmt.exe.TaskInstance; import junit.framework.TestCase; public class testjbpm extends TestCase { public void testProcess() throws Exception{ String x1="non"; System.out.println("enter your value of x1"); x1= clavier.lireString(); java.io.FileReader reader= new java.io.FileReader("eclipse/testjbpm/src/java/testjbpm.par/processdefinition.xml"); JpdlXmlReader test= new JpdlXmlReader(reader); ProcessDefinition definition = test.readProcessDefinition(); assertNotNull("Definition should be not null", definition); ProcessInstance instance = new ProcessInstance(definition); TaskInstance task =new TaskInstance("Analyse DA","acheteur"); if (x1=="non"){ task.end(); System.out.println("la transition est non"); } else{ if(x1=="oui"){ task.end("oui"); System.out.println("la transition est oui"); } else{ System.out.println("problem"); } } System.out.println("task Id is +task.getAvailableTransitions()); instance.signal(); } }
my XPLD FILE:<?xml version="1.0" encoding="UTF-8"?> <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="testjbpm"> <start-state name="start"> <transition name="start_to_AnalyseDA" to="Analyse DA"> </transition> </start-state> <task-node name="Analyse DA"> <transition name="" to="fournisseur existe-t-il?"></transition> </task-node> <decision name="fournisseur existe-t-il?" expression="non"> <transition name="oui" to="traitement DA" > </transition> <transition name="non" to="peut-on réorienter la DA vers fournisseur existant?"> </transition> </decision> <task-node name="traitement DA"> <transition name="" to="end1"></transition> </task-node> <decision name="peut-on réorienter la DA vers fournisseur existant?" expression="oui"> <transition name="oui" to="traitement DA"> </transition> <transition name="non" to="fournisseur existe dans SAP?"> </transition> </decision> ...............
thank you very much for your help
Antitrust1982