Hi Amila, I think benefit of all we'll explain how the output parameters get values once the application gets executed.
Since there is no generic communication framework to communicate with any running program the most intuitive way to determine the output of the program is to analyze its output text (i.e. standard output). However in most cases such output text will be of a data structure/format specific for that program. i.e. Airavata will not know how to process the output data in order to figure-out what data should be returned back to the user. Therefore we have enabled 2 ways to help Airavata figure that out, 1. Get the whole output text as the output returned from the program. This is done by specifying the type of the output parameter as "STD_OUT". It is the responsibility of whatever the next program (or the user) that this output is passed on to as input to determine how to process the information in it. 2. Assume the standard output contains set of "<output_para_name>=<output_value>" values separated by newlines (just like what we have in a conventional properties file). Here the "output_para_name" is the name user gives for the output parameter (in your case "wps output"). The "output_value" is essentially just a piece of text which should represent whatever the program intended it to be. It is users responsibility to know what it represents (FILE/URL/INTEGER etc.) and specify it correctly when defining the output parameters for the application. The 2nd option above (as you may have imagined) is very impractical since in almost all programs the standard output would not be of the form of set of "<output_para_name>=<output_value>" values. In which case what we suggest is to write a wrapper script for your program and let the script output the data correctly. The idea behind here is that given the correct input is passed on to it, the script knows how to run your program and understand the output in order to echo the correct "<output_para_name>=<output_value>" values as standard output. Thus when you add an application to Airavata you will be specifying the path to this script rather than the actual program so that Airavata will execute that script instead with the given input. So when you specify "FILE" as the type of the output parameter what it means to Airavata is that there will be a line in the standard output of executing the program which has "wps output=<some_file_path>" which I imagine in your case you didn't have. Please feel free to ask questions if I wasn't clear enough. Regards, Saminda On Tue, Jun 18, 2013 at 7:57 AM, AMILA RANATUNGA <[email protected]>wrote: > Hi, > > How we can write Airavata out put to a file instead in std out. I tried > something like using API. > > outputParameter.setParameterDescription("wps output"); > ParameterType outputParaType = > outputParameter.addNewParameterType(); > > //if I change the STD_OUT to File > > outputParaType.setType(DataType.FILE); > > > I got the following exception. But I get the output correctly with the > STD_OUT. After that how to save it to custom location? > > > > > <ns:invokingServiceFailed infoModelVersion="2.6" > xmlns:ns="http://airavata.apache.org/schemas/wft/2011/08"> > <ns:notificationSource > ns:serviceID="Workflow1_e5a72bea_ee03_45ac_b8ce_33ab559115e7" > ns:experimentID="Workflow1_e5a72bea-ee03-45ac-b8ce-33ab559115e7" /> > <ns:timestamp>2013-06-18T17:18:18.230+05:30</ns:timestamp> > <ns:description>Error while invoking provider > org.apache.airavata.gfac.provider.impl.LocalProvider dispose method.: > org.apache.airavata.gfac.GFacException: Error while invoking provider > org.apache.airavata.gfac.provider.impl.LocalProvider dispose > method.</ns:description> > <ns:annotation> > <stackTrace>org.apache.airavata.gfac.GFacException: Error while > invoking provider org.apache.airavata.gfac.provider.impl.LocalProvider > dispose method. > at org.apache.airavata.gfac.GFacAPI.disposeProvider(GFacAPI.java:102) > at org.apache.airavata.gfac.GFacAPI.schedule(GFacAPI.java:72) > at org.apache.airavata.gfac.GFacAPI.submitJob(GFacAPI.java:53) > at > > org.apache.airavata.xbaya.invoker.EmbeddedGFacInvoker.invoke(EmbeddedGFacInvoker.java:330) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpreter.handleWSComponent(WorkflowInterpreter.java:682) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpreter.executeDynamically(WorkflowInterpreter.java:501) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpreter.scheduleDynamically(WorkflowInterpreter.java:186) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton.executeWorkflow(WorkflowInterpretorSkeleton.java:385) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton.access$400(WorkflowInterpretorSkeleton.java:78) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton$2.run(WorkflowInterpretorSkeleton.java:378) > at java.lang.Thread.run(Thread.java:722) > Caused by: org.apache.airavata.gfac.provider.GFacProviderException: Error > in retrieving results > at > > org.apache.airavata.gfac.provider.impl.LocalProvider.dispose(LocalProvider.java:138) > at org.apache.airavata.gfac.GFacAPI.disposeProvider(GFacAPI.java:100) > ... 10 more > Caused by: java.lang.Exception: Data for the output parameter 'wps_output' > was not found > at > org.apache.airavata.gfac.utils.OutputUtils.parseStdout(OutputUtils.java:82) > at > > org.apache.airavata.gfac.utils.OutputUtils.fillOutputFromStdout(OutputUtils.java:59) > at > > org.apache.airavata.gfac.provider.impl.LocalProvider.dispose(LocalProvider.java:132) > ... 11 more > </stackTrace> > </ns:annotation> > <ns:receiver ns:serviceID="WPS_invoke" > ns:workflowID="Workflow1_e5a72bea_ee03_45ac_b8ce_33ab559115e7" > ns:workflowTimestep="0" ns:workflowNodeID="WPS_invoke" /> > <ns:failure> > <ns:trace xsi:type="xs:string" xmlns:xs=" > http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:ns="http://airavata.apache.org/schemas/wft/2011/08 > ">org.apache.airavata.gfac.GFacException: > Error while invoking provider > org.apache.airavata.gfac.provider.impl.LocalProvider dispose method. > at org.apache.airavata.gfac.GFacAPI.disposeProvider(GFacAPI.java:102) > at org.apache.airavata.gfac.GFacAPI.schedule(GFacAPI.java:72) > at org.apache.airavata.gfac.GFacAPI.submitJob(GFacAPI.java:53) > at > > org.apache.airavata.xbaya.invoker.EmbeddedGFacInvoker.invoke(EmbeddedGFacInvoker.java:330) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpreter.handleWSComponent(WorkflowInterpreter.java:682) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpreter.executeDynamically(WorkflowInterpreter.java:501) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpreter.scheduleDynamically(WorkflowInterpreter.java:186) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton.executeWorkflow(WorkflowInterpretorSkeleton.java:385) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton.access$400(WorkflowInterpretorSkeleton.java:78) > at > > org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton$2.run(WorkflowInterpretorSkeleton.java:378) > at java.lang.Thread.run(Thread.java:722) > Caused by: org.apache.airavata.gfac.provider.GFacProviderException: Error > in retrieving results > at > > org.apache.airavata.gfac.provider.impl.LocalProvider.dispose(LocalProvider.java:138) > at org.apache.airavata.gfac.GFacAPI.disposeProvider(GFacAPI.java:100) > ... 10 more > Caused by: java.lang.Exception: Data for the output parameter 'wps_output' > was not found > at > org.apache.airavata.gfac.utils.OutputUtils.parseStdout(OutputUtils.java:82) > at > > org.apache.airavata.gfac.utils.OutputUtils.fillOutputFromStdout(OutputUtils.java:59) > at > > org.apache.airavata.gfac.provider.impl.LocalProvider.dispose(LocalProvider.java:132) > ... 11 more > </ns:trace> > </ns:failure> > </ns:invokingServiceFailed> > > > > Thank You ! >
