KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > xml > WhileReader


1 package org.jbpm.bpel.xml;
2
3 import org.w3c.dom.Element JavaDoc;
4
5 import org.jbpm.bpel.def.Activity;
6 import org.jbpm.bpel.def.While;
7 import org.jbpm.bpel.xml.util.NodeUtil;
8
9 /**
10  * Encapsulates the logic to create and connect process elements that constitute
11  * the <i>while</i> structure.
12  * @author Juan Cantú
13  * @version $Revision: 1.4 $ $Date: 2005/06/23 02:22:46 $
14  */

15 public class WhileReader extends ActivityReader {
16
17   protected Activity createActivity() {
18     return new While();
19   }
20   
21   protected void readActivity(Activity activity, Element JavaDoc element) {
22     While whileBlock = (While) activity;
23     //get while condition
24
Element JavaDoc conditionElement = NodeUtil.getElement(element, BpelConstants.NS_BPWS, BpelConstants.ELEM_CONDITION);
25     whileBlock.setCondition(bpelReader.readExpression(conditionElement, whileBlock.getCompositeActivity()));
26     
27     // Build activity
28
Element JavaDoc childElement = bpelReader.getActivityElement(element);
29     bpelReader.readActivity(childElement, whileBlock);
30   }
31 }
32
Popular Tags