Return-Path: X-Original-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 768EBC625 for ; Fri, 29 Jun 2012 05:14:59 +0000 (UTC) Received: (qmail 44733 invoked by uid 500); 29 Jun 2012 05:14:59 -0000 Delivered-To: apmail-incubator-airavata-commits-archive@incubator.apache.org Received: (qmail 44675 invoked by uid 500); 29 Jun 2012 05:14:58 -0000 Mailing-List: contact airavata-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: airavata-dev@incubator.apache.org Delivered-To: mailing list airavata-commits@incubator.apache.org Received: (qmail 44644 invoked by uid 99); 29 Jun 2012 05:14:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jun 2012 05:14:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jun 2012 05:14:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 031D22388962; Fri, 29 Jun 2012 05:14:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1355239 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: interpretor/DoWhileHandler.java invoker/SimpleInvoker.java Date: Fri, 29 Jun 2012 05:14:33 -0000 To: airavata-commits@incubator.apache.org From: raminder@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120629051434.031D22388962@eris.apache.org> Author: raminder Date: Fri Jun 29 05:14:32 2012 New Revision: 1355239 URL: http://svn.apache.org/viewvc?rev=1355239&view=rev Log: handled parsing of output XML to get output value. AIRAVATA-499 Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java?rev=1355239&r1=1355238&r2=1355239&view=diff ============================================================================== --- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java (original) +++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java Fri Jun 29 05:14:32 2012 @@ -47,6 +47,7 @@ import org.apache.airavata.xbaya.ui.moni import org.apache.airavata.xbaya.util.InterpreterUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.xmlpull.infoset.XmlElement; public class DoWhileHandler implements Callable { private static Logger log = LoggerFactory.getLogger(DoWhileHandler.class); @@ -98,10 +99,17 @@ public class DoWhileHandler implements C int i = 0; for (DataPort port : inputPorts) { Object inputVal1 = InterpreterUtil.findInputFromPort(port, invokerMap); + String outputVal = ""; if (null == inputVal1) { throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + doWhileNode.getID()); } - booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + inputVal1 + "'"); + if (inputVal1 instanceof XmlElement) { + + if (((XmlElement) inputVal1).children().iterator().hasNext()) { + outputVal = ((XmlElement) inputVal1).children().iterator().next().toString(); + } + } + booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + outputVal + "'"); i++; } Boolean result = new Boolean(false); Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java?rev=1355239&r1=1355238&r2=1355239&view=diff ============================================================================== --- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java (original) +++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java Fri Jun 29 05:14:32 2012 @@ -26,6 +26,8 @@ import java.util.Iterator; import org.apache.airavata.common.utils.XMLUtil; import org.apache.airavata.workflow.model.exceptions.WorkflowException; import org.apache.jackrabbit.core.cache.ConcurrentCache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xmlpull.v1.builder.XmlElement; import xsul.wsdl.WsdlDefinitions; @@ -40,6 +42,8 @@ import xsul.xwsif_runtime.WSIFRuntime; public class SimpleInvoker implements Invoker { + private static final Logger log = LoggerFactory.getLogger(GenericInvoker.class); + protected WSIFClient client; private WsdlDefinitions definitions; @@ -60,7 +64,7 @@ public class SimpleInvoker implements In /** * Constructs a SimpleInvoker. - * + * * @param definitions */ public SimpleInvoker(WsdlDefinitions definitions) { @@ -196,6 +200,15 @@ public class SimpleInvoker implements In String value = (String) child; return value; } + if (child instanceof XmlElement) { + log.info("output: " + XMLUtil.xmlElementToString((XmlElement) child)); + Object child1 = ((XmlElement) child).children().next(); + if (child1 instanceof String) { + // Value is a simple type. Return the string. + String value = (String) child1; + return value; + } + } } // Value is a complex type. Return the whole XmlElement so that we // can set it to the next service as it is.