airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1433692 - in /airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: invoker/EmbeddedGFacInvoker.java jython/lib/NotificationSender.java jython/lib/ServiceNotificationSender.java
Date Tue, 15 Jan 2013 22:11:17 GMT
Author: lahiru
Date: Tue Jan 15 22:11:17 2013
New Revision: 1433692

URL: http://svn.apache.org/viewvc?rev=1433692&view=rev
Log:
fixing embedded mode issue, with notification failure.

Modified:
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java?rev=1433692&r1=1433691&r2=1433692&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
Tue Jan 15 22:11:17 2013
@@ -58,11 +58,9 @@ import org.apache.airavata.workflow.mode
 import org.apache.airavata.xbaya.XBayaConfiguration;
 import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
 import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.*;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
 import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -256,7 +254,9 @@ public class EmbeddedGFacInvoker impleme
      */
     public synchronized boolean invoke() throws WorkflowException {
         try {
-            createActualParameters();
+            OMElement inputMessage = createActualParameters();
+            Object wsifMessageElement = new WSIFMessageElement(XMLUtil.stringToXmlElement3(inputMessage.toStringWithConsume()));
+            this.notifier.invokingService(new WSIFMessageElement((XmlElement)wsifMessageElement));
             JobContext jobContext = new JobContext(actualParameters, EmbeddedGFacInvoker.this.topic,
                     EmbeddedGFacInvoker.this.serviceName, EmbeddedGFacInvoker.this.gfacURL);
             GFacConfiguration gFacConfiguration = new GFacConfiguration(EmbeddedGFacInvoker.this.configuration.getMyProxyServer(),
@@ -428,25 +428,31 @@ public class EmbeddedGFacInvoker impleme
         return null;
     }
 
-    private void createActualParameters() throws AiravataAPIInvocationException, RegistryException,
XMLStreamException {
+    private OMElement createActualParameters() throws AiravataAPIInvocationException, RegistryException,
XMLStreamException {
+        OMFactory omFactory = OMAbstractFactory.getOMFactory();
+        OMElement invoke_inputParams = omFactory.createOMElement(new QName("invoke_InputParams"));
         ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(this.serviceName);
         if (serviceDescription == null) {
             throw new RegistryException(new Exception("Service Description not found in registry."));
         }
         ServiceDescriptionType serviceDescriptionType = serviceDescription.getType();
-        for(String inputName:this.inputNames) {
+        for (String inputName : this.inputNames) {
+            OMElement omElement = omFactory.createOMElement(new QName(inputName));
             int index = this.inputNames.indexOf(inputName);
             Object value = this.inputValues.get(index);
             InputParameterType parameter = serviceDescriptionType.getInputParametersArray(index);
             if (value instanceof XmlElement) {
-                 XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new
StringReader(XMLUtil.xmlElementToString((XmlElement) value)));
-                 StAXOMBuilder builder = new StAXOMBuilder(reader);
-                 OMElement input = builder.getDocumentElement();
-                 actualParameters.put(parameter, GfacUtils.getInputActualParameter(parameter,
input));
-             } else if (value instanceof String) {
-
-                 actualParameters.put(parameter, GfacUtils.getInputActualParameter(parameter,
AXIOMUtil.stringToOM("<value>" + value + "</value>")));
-             }
+                omElement.setText((String)((XmlElement) value).children().next());
+                XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new
StringReader(XMLUtil.xmlElementToString((XmlElement) value)));
+                StAXOMBuilder builder = new StAXOMBuilder(reader);
+                OMElement input = builder.getDocumentElement();
+                actualParameters.put(parameter, GfacUtils.getInputActualParameter(parameter,
input));
+            } else if (value instanceof String) {
+                omElement.setText((String)value);
+                actualParameters.put(parameter, GfacUtils.getInputActualParameter(parameter,
AXIOMUtil.stringToOM("<value>" + value + "</value>")));
+            }
+            invoke_inputParams.addChild(omElement);
         }
+        return invoke_inputParams;
     }
 }

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java?rev=1433692&r1=1433691&r2=1433692&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
Tue Jan 15 22:11:17 2013
@@ -274,7 +274,7 @@ public class NotificationSender implemen
     @Override
     public ServiceNotifiable createServiceNotificationSender(String nodeID) {
         return new ServiceNotificationSender(this.notifier, this.eventSink, this.initiator,
this.workflowID, nodeID,
-                this.context);
+                this.context,this.invocationContext);
     }
 
     @Override

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java?rev=1433692&r1=1433691&r2=1433692&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
Tue Jan 15 22:11:17 2013
@@ -72,7 +72,7 @@ public class ServiceNotificationSender i
      * @param nodeID
      */
     protected ServiceNotificationSender(WorkflowNotifier notifier, EndpointReference eventSink,
-            InvocationEntity initiator, URI workflowID, String nodeID, WorkflowTrackingContext
context) {
+            InvocationEntity initiator, URI workflowID, String nodeID, WorkflowTrackingContext
context, InvocationContext invocationContext) {
         this.notifier = notifier;
         this.eventSink = eventSink;
         this.initiator = initiator;
@@ -82,7 +82,7 @@ public class ServiceNotificationSender i
         // In case of creating a service on the fly, there is no serviceID at
         // the beginning.
         this.serviceID = "";
-
+        this.invocationContext = invocationContext;
         URI receiverWorkflowID = this.workflowID;
         URI receiverServiceID = URI.create(this.serviceID);
         String receiverWorkflowNodeID = this.nodeID;



Mime
View raw message