bexee.model.xmltobpel

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » bexee » bexee.model.xmltobpel 
bexee.model.xmltobpel

This package contains BPEL process element and activity factories used by the Digester.

BPEL document transformation (XML-OO mapping)

Rationale and description

A deployed BPEL document needs to be transformed in a tree structure of objects representing a BPEL process type. Bexee will then use such a tree structure for the execution of processes. This transformation is a XML to OO mapping and within bexee this task is accomplished with the Jakarta Digester tool http://jakarta.apache.org/commons/digester/.

Briefly, the Digester is configured with an xml mapping description which describes how xml elements contained in BPEL documents will be mapped to the correspondent BPEL activities and elements. For the creation of activity, Digester is configured to use factories. Each activity type has its own specialized factory. In the following showing the usage of Digester and the creation of BPEL process types, this mapping description is called "bpel-rules.xml".

            Digester overwiev
          

It is possible to let Digester create the objects without using specialized factories, but in the case of bexee it is advantageous to use this customized technique. BPEL activities have complex properties and it is easier to create those properties with specialized factories. In addition, BPEL activities and elements reference other elements, e.g. variables from the same BPEL process type. It is therefore necessary to find other elements (variables, partner links, etc.) and associate them with some activities in the BPEL process.

          
            Elements references
          

In order to be able to find other elements and activities existing in a BPEL process type, the factories used by Digester don't create process elements themselves, but delegate this task to a BPELElementFactory. Such a factory exist once per BPEL process, therefore all specialized activity and element factories used by Digester use the same BPELElementFactory, which exists once per BPEL process type. Every process element is registered at creation and can thus be found once referenced in an activity at a later time of BPEL document parsing.

            BPELElementFactory
          


Code and configuration excerpts

Following an excerpt from the Digester xml-oo mapping description "bpel-rules.xml"

"bpel-rules.xml"

          
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE digester-rules SYSTEM "http://bexee.sourceforge.net/dtd/digester-rules.dtd">
<digester-rules>
  <!--  -->
  <!-- parsing the Process -->
  <!--  -->

  <pattern value="process">
    <factory-create-rule classname="bexee.model.xmltobpel.ProcessImplFactory"/>
    <!--  -->
    <!-- parsing the PartnerLinks -->
    <!--  -->
    <pattern value="partnerLinks">

      <object-create-rule classname="bexee.model.elements.impl.PartnerLinksImpl"/>
      <pattern value="partnerLink">
        <factory-create-rule classname="bexee.model.xmltobpel.PartnerLinkImplFactory"/>
        <set-next-rule methodname="addPartnerLink"/>
      </pattern>
      <set-next-rule methodname="setPartnerLinks"/>

    </pattern>
    <!--  -->
    <!-- parsing the Variables -->
    <!--  -->
    <pattern value="variables">
      <object-create-rule classname="bexee.model.elements.impl.VariablesImpl"/>

      <pattern value="variable">
        <factory-create-rule classname="bexee.model.xmltobpel.VariableImplFactory"/>
        <set-next-rule methodname="addVariable"/>
      </pattern>
      <set-next-rule methodname="setVariables"/>
    </pattern>

  <set-next-rule methodname="setProcess"/>
  </pattern>
  <!--  -->
  <!-- parsing the sequence -->
  <!--  -->
  <pattern value="*/sequence">

    <object-create-rule classname="bexee.model.activity.impl.SequenceImpl"/>
    <set-properties-rule />
    <set-next-rule methodname="activity"/>
  </pattern>
  <!--  -->
  <!-- parsing receive -->

  <!--  -->
  <pattern value="*/receive">
    <factory-create-rule classname="bexee.model.xmltobpel.ReceiveImplFactory"/>
    <set-next-rule methodname="activity"/>
  </pattern>
  <!--  -->

  <!-- parsing invoke -->
  <!--  -->
  <pattern value="*/invoke">
    <factory-create-rule classname="bexee.model.xmltobpel.InvokeImplFactory"/>
    <set-next-rule methodname="activity"/>
  </pattern>

</digester-rules>
          

The java code for a factory responsible for the creation of a Receive BPEL activity:

"ReceiveImplFactory.java"

          
public class ReceiveImplFactory extends AbstractObjectCreationFactory {

    public Object createObject(Attributes attributes) throws Exception {

        BPELElementFactory elementFactory = BPELElementFactory
                .getInstance((BPELProcess) getDigester().getRoot());

        String partnerLink = attributes.getValue(PARTNER_LINK);
        String portType = attributes.getValue(PORT_TYPE);
        String operation = attributes.getValue(OPERATION);
        String variable = attributes.getValue(VARIABLE);
        String createInstance = attributes.getValue(CREATE_INSTANCE);

        return elementFactory.createReceive(getStandardAttributes(attributes),
                partnerLink, portType, operation, variable, createInstance);
    }
}
          

As already mentioned, the activity factory only delegates the creation of an Activity to the BPELElementFactory, following an excerpt from this element factory:

"BPELElementFactory.java"

          
public class BPELElementFactory {

    ...
    ...
    ...          
          
    private Map variables = new Hashtable();

    public Variable createVariable(String name, String messageType,
            String type, String element) {

        Variable variable = new VariableImpl();

        variable.setName(name);
        variable.setMessageType(expandToQName(messageType));
        variable.setType(expandToQName(type));
        variable.setElement(expandToQName(element));

        variables.put(name, variable);

        return variable;
    }
          
    public Object createReceive(StandardAttributes standardAttributes,
            String partnerLinkName, String portTypeString, String operation,
            String variableName, String createInstance) {

        PartnerLink partnerLink = retrievePartnerLink(partnerLinkName);
        QName portType = expandToQName(portTypeString);
        Variable variable = retrieveVariable(variableName);

        Receive receive = new ReceiveImpl(standardAttributes, partnerLink,
                portType, operation, variable, createInstance);

        return receive;
    }

    public Variable retrieveVariable(String variableName) {
        if (StringUtils.isNullOrEmpty(variableName)) {
            return null;
        }
        return (Variable) variables.get(variableName);
    }
    
    ...
    ...
    ...
          


Pawel Kowalski
Last modified: $Revision: 1.2 $, $Date: 2004/11/18 14:08:21 $
Java Source File NameTypeComment
AbstractObjectCreationFactory.javaClass This class should be used as superclass by all classes wishing to transform BPEL xml elements into corresponding objects.
AbstractObjectCreationFactoryTest.javaClass
ActivityImplFactoryTest.javaClass
AssignImplFactory.javaClass This class is used by the Digester for the transformation of Assign activities from a BPEL document into AssignImpl objects.
BpelCaseImplFactory.javaClass This class is used by the Digester for the transformation of Switch Case elements from a BPEL document into BpelCaseImpl objects.
BPELElementFactory.javaClass This is a factory for the creation of BPEL process elements.
BPELElementFactoryTest.javaClass
CorrelationsImplFactory.javaClass This class is used by the Digester for the transformation of Correlations elements from a BPEL document into CorrelationImpl objects.
FromImplFactory.javaClass This class is used by the Digester for the transformation of From elements from a BPEL document into FromImpl objects.
InvokeImplFactory.javaClass This class is used by the Digester for the transformation of Invoke activities from a BPEL document into InvokeImpl objects.
PartnerLinkImplFactory.javaClass This class is used by the Digester for the transformation of PartnerLink elements from a BPEL document into PartnerLinkImpl objects.
ProcessImplFactory.javaClass This class is used by the Digester for the transformation of a process from a BPEL document into a ProcessImpl object.
ReceiveImplFactory.javaClass This class is used by the Digester for the transformation of Receive activities from a BPEL document into ReceiveImpl objects.
ReplyImplFactory.javaClass This class is used by the Digester for the transformation of Reply activities from a BPEL document into ReplyImpl objects.
SwitchImplFactory.javaClass This class is used by the Digester for the transformation of Switch activities from a BPEL document into SwitchImpl objects.
ToImplFactory.javaClass This class is used by the Digester for the transformation of To elements from a BPEL document into ToImpl objects.
VariableImplFactory.javaClass This class is used by the Digester for the transformation of Variable elements from a BPEL document into VariableImpl objects.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.