View Javadoc

1   /*
2    * $Id: MuleSendBinding.java 21943 2011-05-18 14:23:26Z aperepel $
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.xml.JpdlParser;
15  import org.jbpm.pvm.internal.util.XmlUtil;
16  import org.jbpm.pvm.internal.xml.Parse;
17  import org.w3c.dom.Element;
18  
19  public class MuleSendBinding extends JpdlBinding
20  {
21      public MuleSendBinding()
22      {
23          super("mule-send");
24      }
25  
26      @Override
27      public Object parseJpdl(Element element, Parse parse, JpdlParser parser)
28      {
29          MuleSendActivity activity = new MuleSendActivity();
30  
31          activity.setEndpoint(XmlUtil.attribute(element, "endpoint", parse));
32  
33          if (element.hasAttribute("exchange-pattern"))
34          {
35              activity.setMessageExchangePattern((XmlUtil.attribute(element, "exchange-pattern", parse)));
36          }
37          
38          if (element.hasAttribute("expr"))
39          {
40              activity.setPayloadExpression(XmlUtil.attribute(element, "expr", parse));
41          }
42          
43          if (element.hasAttribute("var"))
44          {
45              activity.setResponseVariableName(XmlUtil.attribute(element, "var", parse));
46          }
47          
48          if (element.hasAttribute("type"))
49          {
50              activity.setResponsePayloadClass(XmlUtil.attribute(element, "type", parse));
51          }
52  
53          return activity;
54      }
55  }