View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.jbpm;
8   
9   import org.jbpm.jpdl.internal.activity.JpdlBinding;
10  import org.jbpm.jpdl.internal.xml.JpdlParser;
11  import org.jbpm.pvm.internal.util.XmlUtil;
12  import org.jbpm.pvm.internal.xml.Parse;
13  import org.w3c.dom.Element;
14  
15  public class MuleSendBinding extends JpdlBinding
16  {
17      public MuleSendBinding()
18      {
19          super("mule-send");
20      }
21  
22      @Override
23      public Object parseJpdl(Element element, Parse parse, JpdlParser parser)
24      {
25          MuleSendActivity activity = new MuleSendActivity();
26  
27          activity.setEndpoint(XmlUtil.attribute(element, "endpoint", parse));
28  
29          if (element.hasAttribute("exchange-pattern"))
30          {
31              activity.setMessageExchangePattern((XmlUtil.attribute(element, "exchange-pattern", parse)));
32          }
33          
34          if (element.hasAttribute("expr"))
35          {
36          	activity.setPayloadExpression(XmlUtil.attribute(element, "expr", parse));
37          }
38          
39          if (element.hasAttribute("var"))
40          {
41          	activity.setResponseVariableName(XmlUtil.attribute(element, "var", parse));
42          }
43          
44          if (element.hasAttribute("type"))
45          {
46          	activity.setResponsePayloadClass(XmlUtil.attribute(element, "type", parse));
47          }
48  
49          return activity;
50      }
51  }