Class BPELGenerator

java.lang.Object
  |
  +--BPELGenerator

public class BPELGenerator
extends java.lang.Object

This class has methods to generate a process from the process template


Constructor Summary
BPELGenerator()
          Constructor
BPELGenerator(java.lang.String pWSDL_URL, java.lang.String pOpName, java.lang.String templateURL, java.lang.String utilsFNS)
          Construcutor
 
Method Summary
 void addToActivityMap(java.lang.String attrValue, org.w3c.dom.Node node)
          Adds an activity to the activity hash map
 void buildAssignmentVector(boolean toRead)
          Builds or Reads the assignmentVecor that contains AssignWrapper objects
 void buildDiscoveryMap()
          Adds WSDLDetailsWrapper objects of activities of type "WSInterface" or "SemanticTemplate" to discoveryMap object
 void buildProcess()
          Builds the process from the hierarchyMap
 void buildVariableAssignVector(boolean toRead)
          Builds or Reads the variableAssignmentMap that contains VariableAssignWrapper objects
 void cleanUp(java.lang.String fileNameToRead, java.lang.String fileNameToWrite, java.lang.String utilsNS)
          Cleans up the generated BPEL process by removing redundant namespaces, fixing partners, containers and assign tags
 org.w3c.dom.Document completeAssignTags(org.w3c.dom.Document cDoc)
          Completes Assign tags in the process
 org.w3c.dom.Document completeAssignTagsPreExisitingFromAndTo(org.w3c.dom.Document cDoc)
          Completes Assign tags in the process.
 org.w3c.dom.Document createDomDocument()
          Creates a DOM document
 java.lang.String getMessageLocalPartName(java.lang.String wsdlFileURL, java.lang.String operationName, boolean inputMessages)
          Gets Input/Ouput Messages of a given operation in a WSDL file
 javax.xml.namespace.QName getMessageQName(java.lang.String wsdlFileURL, java.lang.String operationName, boolean inputMessages)
          Gets Input/Ouput Messages of a given operation in a WSDL file
 java.lang.String getPartnerSLT()
          Returns the Service Link Type details of the Process WSDL
 java.lang.String getPortType(java.lang.String wsdlFileURL, java.lang.String opName)
          Gets the port type name of a operation in a WSDL file
 javax.xml.namespace.QName getPortTypeQName(java.lang.String wsdlFileURL, java.lang.String opName)
          Gets the port type name of a operation in a WSDL file
static void main(java.lang.String[] args)
          used only for testing purposes
 org.w3c.dom.Document parseXmlFile(java.lang.String filename, boolean validating)
          Parses an XML file and returns a DOM document.
 com.ibm.bpws.model.BPWSProcess readProcessFromFile(java.lang.String fileName)
          This method reads a BPEL process from a file
 org.w3c.dom.Document readXMLToDOM(java.lang.String fileName)
          This method reads an XML file as a Document Object
 void replaceInvokeActivityElements(org.w3c.dom.Document doc)
          This method replaces all"invoke-activity" element in the Document
 void replaceProcessTemplateElement(org.w3c.dom.Document doc)
          This method replaces all"process-template" element in the Document with "process"
 void setDiscoveryMap(java.util.HashMap discMap)
          This method sets the discovery Map
 void utilsGenerator(java.lang.String targetNS)
          Generates utils description (WSDL file) which is a support file for the process
 void visitAllNodes(org.w3c.dom.Node node, int level)
          This method visits all the nodes in a DOM tree
 void writeProcessToFile(java.lang.String fileName, com.ibm.bpws.model.BPWSProcess process)
          This method writes a BPEL process to a file
 void writeXmlFile(org.w3c.dom.Document doc, java.lang.String filename)
          This method writes a DOM document to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BPELGenerator

public BPELGenerator(java.lang.String pWSDL_URL,
                     java.lang.String pOpName,
                     java.lang.String templateURL,
                     java.lang.String utilsFNS)
              throws java.lang.Exception
Construcutor


BPELGenerator

public BPELGenerator()
Constructor

Method Detail

setDiscoveryMap

public void setDiscoveryMap(java.util.HashMap discMap)
This method sets the discovery Map

Returns:
BPWSProcess Process that is read from the file

readProcessFromFile

public com.ibm.bpws.model.BPWSProcess readProcessFromFile(java.lang.String fileName)
                                                   throws java.lang.Exception
This method reads a BPEL process from a file

Returns:
BPWSProcess Process that is read from the file
java.lang.Exception

writeProcessToFile

public void writeProcessToFile(java.lang.String fileName,
                               com.ibm.bpws.model.BPWSProcess process)
                        throws java.lang.Exception
This method writes a BPEL process to a file

java.lang.Exception

readXMLToDOM

public org.w3c.dom.Document readXMLToDOM(java.lang.String fileName)
This method reads an XML file as a Document Object

Returns:
Document Object that is read from the file

parseXmlFile

public org.w3c.dom.Document parseXmlFile(java.lang.String filename,
                                         boolean validating)
Parses an XML file and returns a DOM document.

Returns:
Document Object that is read from the file

writeXmlFile

public void writeXmlFile(org.w3c.dom.Document doc,
                         java.lang.String filename)
This method writes a DOM document to a file


replaceInvokeActivityElements

public void replaceInvokeActivityElements(org.w3c.dom.Document doc)
This method replaces all"invoke-activity" element in the Document


replaceProcessTemplateElement

public void replaceProcessTemplateElement(org.w3c.dom.Document doc)
This method replaces all"process-template" element in the Document with "process"


visitAllNodes

public void visitAllNodes(org.w3c.dom.Node node,
                          int level)
This method visits all the nodes in a DOM tree


addToActivityMap

public void addToActivityMap(java.lang.String attrValue,
                             org.w3c.dom.Node node)
Adds an activity to the activity hash map


buildProcess

public void buildProcess()
Builds the process from the hierarchyMap


getPortType

public java.lang.String getPortType(java.lang.String wsdlFileURL,
                                    java.lang.String opName)
Gets the port type name of a operation in a WSDL file

Returns:
String Name of the port type

getPortTypeQName

public javax.xml.namespace.QName getPortTypeQName(java.lang.String wsdlFileURL,
                                                  java.lang.String opName)
Gets the port type name of a operation in a WSDL file

Returns:
QName QName of the porttype

getMessageLocalPartName

public java.lang.String getMessageLocalPartName(java.lang.String wsdlFileURL,
                                                java.lang.String operationName,
                                                boolean inputMessages)
Gets Input/Ouput Messages of a given operation in a WSDL file

Returns:
String LocalName

getMessageQName

public javax.xml.namespace.QName getMessageQName(java.lang.String wsdlFileURL,
                                                 java.lang.String operationName,
                                                 boolean inputMessages)
Gets Input/Ouput Messages of a given operation in a WSDL file

Returns:
QName of input/output

utilsGenerator

public void utilsGenerator(java.lang.String targetNS)
Generates utils description (WSDL file) which is a support file for the process


createDomDocument

public org.w3c.dom.Document createDomDocument()
Creates a DOM document

Returns:
Document dom doc that is created

cleanUp

public void cleanUp(java.lang.String fileNameToRead,
                    java.lang.String fileNameToWrite,
                    java.lang.String utilsNS)
Cleans up the generated BPEL process by removing redundant namespaces, fixing partners, containers and assign tags


completeAssignTags

public org.w3c.dom.Document completeAssignTags(org.w3c.dom.Document cDoc)
Completes Assign tags in the process


completeAssignTagsPreExisitingFromAndTo

public org.w3c.dom.Document completeAssignTagsPreExisitingFromAndTo(org.w3c.dom.Document cDoc)
Completes Assign tags in the process. Works for DOMs if FROM and TO Tags preexist


getPartnerSLT

public java.lang.String getPartnerSLT()
Returns the Service Link Type details of the Process WSDL


buildDiscoveryMap

public void buildDiscoveryMap()
Adds WSDLDetailsWrapper objects of activities of type "WSInterface" or "SemanticTemplate" to discoveryMap object


buildAssignmentVector

public void buildAssignmentVector(boolean toRead)
Builds or Reads the assignmentVecor that contains AssignWrapper objects


buildVariableAssignVector

public void buildVariableAssignVector(boolean toRead)
Builds or Reads the variableAssignmentMap that contains VariableAssignWrapper objects


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
used only for testing purposes

java.lang.Exception