You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/07/02 21:13:57 UTC

svn commit: r1356420 - /incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java

Author: lahiru
Date: Mon Jul  2 19:13:56 2012
New Revision: 1356420

URL: http://svn.apache.org/viewvc?rev=1356420&view=rev
Log:
Fixing issue with WorkflwoContext Header parsing from XBaya to Gfac.

Modified:
    incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java

Modified: incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java?rev=1356420&r1=1356419&r2=1356420&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java Mon Jul  2 19:13:56 2012
@@ -22,6 +22,7 @@ package org.apache.airavata.common.workf
 
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.schemas.wec.*;
+import org.apache.xmlbeans.XmlException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xmlpull.v1.builder.XmlElement;
@@ -317,6 +318,7 @@ public class WorkflowContextHeaderBuilde
     }
 
     public static ContextHeaderDocument.ContextHeader removeOtherSchedulingConfig(String nodeID, ContextHeaderDocument.ContextHeader header) {
+        String s = XMLUtil.xmlElementToString(new WorkflowContextHeaderBuilder(header).getXml());
         try {
             ApplicationSchedulingContextDocument.ApplicationSchedulingContext[] applicationSchedulingContextArray =
                     header.getWorkflowSchedulingContext().getApplicationSchedulingContextArray();
@@ -336,6 +338,14 @@ public class WorkflowContextHeaderBuilde
         } catch (NullPointerException e) {
             return header;
         }
+        ContextHeaderDocument parse = null;
+        try {
+            parse = ContextHeaderDocument.Factory.parse(s);
+        } catch (XmlException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+        //Set Old Context Header in to currentContextHeader
+        WorkflowContextHeaderBuilder.setCurrentContextHeader(parse.getContextHeader());
         return header;
     }
 }