Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [bpel-dev] Accessing BPELWriter from BPELExtensionSerializer

Hi Simon,

Sorry it took this long, but we finally made the patch (see the attached file) for your review. With this patch, an extension activity can become a structured activity (like Scope or Flow) that contains other activities. Also, the same applies for an extension element such as OnAlarm or OnMessage as used by the Pick activity.

Please let us know if you have any questions.

Regards,
Hanyu 
-----------------------
Hanyu Xiao
Tibco Software Inc.
3303 Hillview Ave. 
Palo Alto, CA 94304

-----Original Message-----
From: bpel-dev-bounces@xxxxxxxxxxx [mailto:bpel-dev-bounces@xxxxxxxxxxx] On Behalf Of Simon D Moser
Sent: Wednesday, June 11, 2008 7:55 AM
To: BPEL Designer project developer discussions.
Subject: RE: [bpel-dev] Accessing BPELWriter from BPELExtensionSerializer

Hi Hanyu,

you checkout all the BPEL Designer plugins from CVS, fix what you want in
your local workspace. After you have done that, you select the plugins that
are marked dirty, right click and select "Team->Create Patch". Walk the
wizard and then send us the file it produces so we can review and possibly
integrate it.

Thanks
Simon

Simon Moser, M.Eng.


                                                                          
 Websphere Integration       Mail:           IBM Deutschland Entwicklung  
 Developer Development       smoser@xxxxxx.  GmbH                         
 Team Lead BPEL Editor       com             Vorsitzender des             
 Dept. 4722, Bldg.           Phone:          Aufsichtsrats: Martin Jetter 
 71032-01, Room 086          +49-7031-16-43  Geschäftsführung: Herbert    
 Websphere Solutions and     04              Kircher                      
 Services                    Fax:            Sitz der Gesellschaft:       
 IBM Deutschland             +49-7031-16-48  Böblingen                    
 Entwicklung GmbH            90              Registergericht: Amtsgericht 
 Schönaicherstr. 220, D -                    Stuttgart, HRB 243294        
 71032 Boeblingen                                                         
                                                                          











                                                                                                                               
  From:       "Hanyu Xiao" <hxiao@xxxxxxxxx>                                                                                   
                                                                                                                               
  To:         "BPEL Designer project developer discussions." <bpel-dev@xxxxxxxxxxx>                                            
                                                                                                                               
  Date:       11.06.2008 16:37                                                                                                 
                                                                                                                               
  Subject:    RE: [bpel-dev] Accessing BPELWriter from BPELExtensionSerializer                                                 
                                                                                                                               





Hi Simon,

Sorry for the dumb question, but how do I produce a patch?

Hanyu

-----Original Message-----
From: bpel-dev-bounces@xxxxxxxxxxx [mailto:bpel-dev-bounces@xxxxxxxxxxx] On
Behalf Of Simon D Moser
Sent: Tuesday, June 10, 2008 12:48 AM
To: BPEL Designer project developer discussions.
Subject: Re: [bpel-dev] Accessing BPELWriter from BPELExtensionSerializer

Hey Hanyu,

sounds reasonable - can I ask you to provide a patch for this ?
Thank you!

Cheers
Simon

Simon Moser, M.Eng.



 Websphere Integration       Mail:           IBM Deutschland Entwicklung
 Developer Development       smoser@xxxxxx.  GmbH
 Team Lead BPEL Editor       com             Vorsitzender des
 Dept. 4722, Bldg.           Phone:          Aufsichtsrats: Martin Jetter
 71032-01, Room 086          +49-7031-16-43  Geschäftsführung: Herbert
 Websphere Solutions and     04              Kircher
 Services                    Fax:            Sitz der Gesellschaft:
 IBM Deutschland             +49-7031-16-48  Böblingen
 Entwicklung GmbH            90              Registergericht: Amtsgericht
 Schönaicherstr. 220, D -                    Stuttgart, HRB 243294
 71032 Boeblingen













  From:       "Hanyu Xiao" <hxiao@xxxxxxxxx>


  To:         "BPEL Designer project developer discussions."
<bpel-dev@xxxxxxxxxxx>

  Cc:         Steve Goldberg <goldberg@xxxxxxxxx>


  Date:       06.06.2008 11:10


  Subject:    [bpel-dev] Accessing BPELWriter from BPELExtensionSerializer







Hello,

We are trying to figure out a way to call BPELWriter from
BPELExtensionSerializer (and BPELReader from BPELExtensionDeserializer).
Unlike BPELActivitySerializer, whose marshall() method is passed the
BPELWriter instance in the last parameter, BPELExtensionSerializer's
marshall() method is passed the BPELExtensionRegistry instance instead.

Could we suggest that the BPELWriter be added as a parameter to
BPELExtensionSerializer.marshall()? We need this because we are embedding a
BPEL activity inside an extension element.

Thanks,
Hanyu_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev

_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev

Index: src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionSerializer.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionSerializer.java,v
retrieving revision 1.2
diff -u -r1.2 BPELUnknownExtensionSerializer.java
--- src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionSerializer.java	26 Jul 2007 01:34:12 -0000	1.2
+++ src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionSerializer.java	17 Jul 2008 18:15:09 -0000
@@ -28,6 +28,7 @@
 import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
 import org.apache.xerces.util.DOMUtil;
 import org.eclipse.bpel.model.Process;
+import org.eclipse.bpel.model.resource.BPELWriter;
 import org.eclipse.bpel.model.util.BPELUtils;
 import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
 import org.eclipse.xsd.util.XSDConstants;
@@ -43,7 +44,7 @@
 
 public class BPELUnknownExtensionSerializer extends UnknownExtensionSerializer implements BPELExtensionSerializer {
 	
-	public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, Node parentNode, Process process, ExtensionRegistry extReg) throws WSDLException {
+	public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, Node parentNode, Process process, ExtensionRegistry extReg, BPELWriter bpelWriter) throws WSDLException {
 		Map<String,String> nsMap = BPELUtils.getNamespaceMap(process);
 		Element unknownElement = null;
 		
Index: src/org/eclipse/bpel/model/extensions/BPELExtensionSerializer.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELExtensionSerializer.java,v
retrieving revision 1.1
diff -u -r1.1 BPELExtensionSerializer.java
--- src/org/eclipse/bpel/model/extensions/BPELExtensionSerializer.java	29 Nov 2005 18:50:27 -0000	1.1
+++ src/org/eclipse/bpel/model/extensions/BPELExtensionSerializer.java	17 Jul 2008 18:15:09 -0000
@@ -16,6 +16,7 @@
 import javax.xml.namespace.QName;
 
 import org.eclipse.bpel.model.Process;
+import org.eclipse.bpel.model.resource.BPELWriter;
 import org.w3c.dom.Node;
 
 
@@ -30,5 +31,5 @@
 	 * This method serializes extension-specific instances of
 	 * ExtensibilityElement into the given parent element.
 	 */
-	public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, Node parentNode, Process process, ExtensionRegistry extReg) throws WSDLException;
+	public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, Node parentNode, Process process, ExtensionRegistry extReg, BPELWriter bpelWriter) throws WSDLException;
 }
\ No newline at end of file
Index: src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionDeserializer.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionDeserializer.java,v
retrieving revision 1.2
diff -u -r1.2 BPELUnknownExtensionDeserializer.java
--- src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionDeserializer.java	26 Oct 2007 16:28:16 -0000	1.2
+++ src/org/eclipse/bpel/model/extensions/BPELUnknownExtensionDeserializer.java	17 Jul 2008 18:15:09 -0000
@@ -20,6 +20,7 @@
 
 import org.eclipse.bpel.model.BPELFactory;
 import org.eclipse.bpel.model.Process;
+import org.eclipse.bpel.model.resource.BPELReader;
 import org.eclipse.bpel.model.UnknownExtensibilityAttribute;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.wst.wsdl.UnknownExtensibilityElement;
@@ -32,7 +33,7 @@
 
 public class BPELUnknownExtensionDeserializer extends UnknownExtensionDeserializer implements BPELExtensionDeserializer {
 
-	public ExtensibilityElement unmarshall(Class parentType, QName elementType, Node node, Process process, Map nsMap, ExtensionRegistry extReg, URI uri) throws WSDLException {
+	public ExtensibilityElement unmarshall(Class parentType, QName elementType, Node node, Process process, Map nsMap, ExtensionRegistry extReg, URI uri, BPELReader bpelReader) throws WSDLException {
 		if (node instanceof Element) {			
 			if (elementType.getLocalPart().equals("extensibilityAttributes")) {
 				UnknownExtensibilityAttribute unknownExt = BPELFactory.eINSTANCE.createUnknownExtensibilityAttribute();
Index: src/org/eclipse/bpel/model/extensions/BPELExtensionDeserializer.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELExtensionDeserializer.java,v
retrieving revision 1.1
diff -u -r1.1 BPELExtensionDeserializer.java
--- src/org/eclipse/bpel/model/extensions/BPELExtensionDeserializer.java	29 Nov 2005 18:50:27 -0000	1.1
+++ src/org/eclipse/bpel/model/extensions/BPELExtensionDeserializer.java	17 Jul 2008 18:15:09 -0000
@@ -18,6 +18,7 @@
 import javax.xml.namespace.QName;
 
 import org.eclipse.bpel.model.Process;
+import org.eclipse.bpel.model.resource.BPELReader;
 import org.eclipse.emf.common.util.URI;
 import org.w3c.dom.Node;
 
@@ -35,6 +36,6 @@
 	 * return value should be explicitly cast to the more-specific
 	 * implementing type.
 	 */
-	public ExtensibilityElement unmarshall(Class parentType, QName elementType, Node node, Process process, Map nsMap, ExtensionRegistry extReg, URI uri) throws WSDLException;
+	public ExtensibilityElement unmarshall(Class parentType, QName elementType, Node node, Process process, Map nsMap, ExtensionRegistry extReg, URI uri, BPELReader bpelReader) throws WSDLException;
 	
 }
\ No newline at end of file
Index: src/org/eclipse/bpel/model/util/ElementFactory.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ElementFactory.java,v
retrieving revision 1.13
diff -u -r1.13 ElementFactory.java
--- src/org/eclipse/bpel/model/util/ElementFactory.java	13 May 2008 12:42:16 -0000	1.13
+++ src/org/eclipse/bpel/model/util/ElementFactory.java	17 Jul 2008 18:15:09 -0000
@@ -90,7 +90,7 @@
 		}
 
 		@Override
-		protected Element activity2XML(org.eclipse.bpel.model.Activity activity) {
+		public Element activity2XML(org.eclipse.bpel.model.Activity activity) {
 			return super.activity2XML(activity);
 		}
 
@@ -549,14 +549,13 @@
 	public String createName(WSDLElement element, QName name) {
 		String namespace = name.getNamespaceURI();
 		String prefix = BPELUtils.getNamespacePrefix(element, namespace);
-		String localPart = name.getLocalPart();
-		if (localPart == "") {
-			return null;
-		} else if (prefix != null) {
-			return prefix + ":" + localPart;
-		}
-		
-		return localPart;
+		if (prefix != null) {
+			return prefix + ":" + name.getLocalPart();
+		} else
+			return name.getLocalPart();
+		// return
+		// getWriter(element).getNamespacePrefixManager().qNameToString(element,
+		// name);
 	}
 
 	private MyBPELWriter getWriter(Object parent) {
Index: src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java,v
retrieving revision 1.13
diff -u -r1.13 ReconciliationBPELReader.java
--- src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java	5 May 2008 07:33:18 -0000	1.13
+++ src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java	17 Jul 2008 18:15:10 -0000
@@ -3057,7 +3057,7 @@
 								.unmarshall(ExtensibleElement.class, qname,
 										childElement, process, nsMap,
 										extensionRegistry, getResource()
-												.getURI());
+												.getURI(), this);
 						serviceRef.setValue(extensibilityElement);
 					} catch (WSDLException e) {
 						throw new WrappedException(e);
@@ -3665,7 +3665,7 @@
 		try {
 			ExtensibilityElement extensibilityElement = deserializer
 					.unmarshall(ee.getClass(), qname, elm, process, nsMap,
-							extensionRegistry, getResource().getURI());
+							extensionRegistry, getResource().getURI(), this);
 			ee.addExtensibilityElement(extensibilityElement);
 		} catch (WSDLException e) {
 			throw new WrappedException(e);
@@ -3715,7 +3715,7 @@
 			ExtensibilityElement extensibilityElement = deserializer
 					.unmarshall(ExtensibleElement.class, qname, tempElement,
 							process, nsMap, extensionRegistry, getResource()
-									.getURI());
+									.getURI(), this);
 			if (extensibilityElement != null) {
 				ee.addExtensibilityElement(extensibilityElement);
 			}
Index: src/org/eclipse/bpel/model/resource/BPELReader.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELReader.java,v
retrieving revision 1.44
diff -u -r1.44 BPELReader.java
--- src/org/eclipse/bpel/model/resource/BPELReader.java	12 Mar 2008 17:18:08 -0000	1.44
+++ src/org/eclipse/bpel/model/resource/BPELReader.java	17 Jul 2008 18:15:09 -0000
@@ -1471,7 +1471,7 @@
     /**
 	 * Converts an XML activity element to a BPEL Activity object.
 	 */
-     protected Activity xml2Activity(Element activityElement) {
+     public Activity xml2Activity(Element activityElement) {
 		Activity activity = null;
 		boolean checkExtensibility = true;
 
@@ -2766,7 +2766,7 @@
 						// ExtensibleElement
 						try {
 							Map<String,String> nsMap = getAllNamespacesForElement(serviceRefElement);
-							ExtensibilityElement extensibilityElement=deserializer.unmarshall(ExtensibleElement.class,qname,childElement,process,nsMap,extensionRegistry,getResource().getURI());
+							ExtensibilityElement extensibilityElement=deserializer.unmarshall(ExtensibleElement.class,qname,childElement,process,nsMap,extensionRegistry,getResource().getURI(),this);
 							serviceRef.setValue(extensibilityElement);
 						} catch (WSDLException e) {
 							throw new WrappedException(e);
@@ -3329,7 +3329,7 @@
 		// ExtensibleElement
 		Map<String,String> nsMap = getAllNamespacesForElement (elm);
 		try {			
-			ExtensibilityElement extensibilityElement = deserializer.unmarshall(ee.getClass(),qname,elm,process,nsMap,extensionRegistry,getResource().getURI());
+			ExtensibilityElement extensibilityElement = deserializer.unmarshall(ee.getClass(),qname,elm,process,nsMap,extensionRegistry,getResource().getURI(),this);
 			ee.addExtensibilityElement(extensibilityElement);
 		} catch (WSDLException e) {
 			throw new WrappedException(e);
@@ -3369,7 +3369,7 @@
 		// ExtensibleElement
 		Map<String,String> nsMap = getAllNamespacesForElement( (Element) attr.getParentNode() );
 		try {			
-			ExtensibilityElement extensibilityElement = deserializer.unmarshall(ExtensibleElement.class,qname,tempElement,process,nsMap,extensionRegistry,getResource().getURI());
+			ExtensibilityElement extensibilityElement = deserializer.unmarshall(ExtensibleElement.class,qname,tempElement,process,nsMap,extensionRegistry,getResource().getURI(),this);
 			if (extensibilityElement!=null) {
 				ee.addExtensibilityElement (extensibilityElement);
 			}
Index: src/org/eclipse/bpel/model/resource/BPELWriter.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELWriter.java,v
retrieving revision 1.51
diff -u -r1.51 BPELWriter.java
--- src/org/eclipse/bpel/model/resource/BPELWriter.java	13 May 2008 12:42:16 -0000	1.51
+++ src/org/eclipse/bpel/model/resource/BPELWriter.java	17 Jul 2008 18:15:09 -0000
@@ -181,7 +181,8 @@
 
 			// For each existing import in the process, add it to the namespace
 			// map.
-			for (Import imp : fProcessContext.getImports()) {
+			for (Object next : fProcessContext.getImports()) {
+				Import imp = (org.eclipse.bpel.model.Import) next;
 				if (imp.getLocation() == null) {
 					System.err.println("Import location is unexpectedly null: "
 							+ imp);
@@ -1054,7 +1055,7 @@
 		return eventHandlerElement;
 	}
 
-	protected Element activity2XML(Activity activity) {
+	public Element activity2XML(Activity activity) {
 
 		Element activityElement = null;
 
@@ -1605,7 +1606,7 @@
 				try {
 					serializer.marshall(ExtensibleElement.class, qname,
 							extensibilityElement, fragment, getProcess(),
-							extensionRegistry);
+							extensionRegistry, this);
 					Element child = (Element) fragment.getFirstChild();
 					return child;
 				} catch (WSDLException e) {
@@ -2248,7 +2249,7 @@
 				try {
 					serializer.marshall(ExtensibleElement.class, qname,
 							extensibilityElement, fragment, getProcess(),
-							extensionRegistry);
+							extensionRegistry, this);
 				} catch (WSDLException e) {
 					throw new WrappedException(e);
 				}
@@ -2333,7 +2334,7 @@
 			serializer
 					.marshall(ExtensibleElement.class, qname,
 							extensibilityElement, fragment, getProcess(),
-							extensionRegistry);
+							extensionRegistry, this);
 			return (Element) fragment.getFirstChild();
 		} catch (WSDLException e) {
 			throw new WrappedException(e);

Back to the top