Coverage Report - org.mule.module.jbpm.MuleReceiveBinding
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleReceiveBinding
0%
0/14
0%
0/8
3
 
 1  
 /*
 2  
  * $Id: MuleReceiveBinding.java 20121 2010-11-08 17:33:48Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.module.jbpm;
 12  
 
 13  
 import org.jbpm.jpdl.internal.activity.JpdlBinding;
 14  
 import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
 15  
 import org.jbpm.jpdl.internal.xml.JpdlParser;
 16  
 import org.jbpm.pvm.internal.model.ActivityImpl;
 17  
 import org.jbpm.pvm.internal.util.XmlUtil;
 18  
 import org.jbpm.pvm.internal.xml.Parse;
 19  
 import org.w3c.dom.Element;
 20  
 
 21  
 public class MuleReceiveBinding extends JpdlBinding
 22  
 {
 23  
     public MuleReceiveBinding()
 24  
     {
 25  0
         super("mule-receive");
 26  0
     }
 27  
 
 28  
     public Object parseJpdl(Element element, Parse parse, JpdlParser parser)
 29  
     {
 30  
         MuleReceiveActivity activity;
 31  
         
 32  0
         JpdlProcessDefinition processDefinition = parse.contextStackFind(JpdlProcessDefinition.class);        
 33  0
         if (processDefinition.getInitial() == null) 
 34  
         {
 35  0
             processDefinition.setInitial(parse.contextStackFind(ActivityImpl.class));          
 36  0
             activity = new MuleReceiveActivity(true);
 37  
         } 
 38  
         else
 39  
         {
 40  0
             activity = new MuleReceiveActivity(false);
 41  
         }
 42  
 
 43  0
         if (element.hasAttribute("var"))
 44  0
             activity.setVariableName(XmlUtil.attribute(element, "var", parse));
 45  
         
 46  0
         if (element.hasAttribute("endpoint"))
 47  0
             activity.setEndpoint(XmlUtil.attribute(element, "endpoint", parse));
 48  
         
 49  0
         if (element.hasAttribute("type"))
 50  0
             activity.setPayloadClass(XmlUtil.attribute(element, "type", parse));
 51  
 
 52  0
         return activity;
 53  
     }
 54  
 }