list archives . users mailing list

Subject: Re: Need help with ogsadai scripts

Date view Thread view Subject view Author view Attachment view

From: George Hicken1 (HICKENG@uk.ibm.com)
Date: Mar 28, 2003 12:09

Shishir,

Firstly my apologies for not responding to your query about multiple
statements sooner.
We are working towards release 2 at the moment and this should fix some of
the problems you are having. Release 2 moves much closer to the DIAS
specification with the main exception being the way parameterization is
done.
It would be useful to us if you could detail what it is you are trying to
do so that we can check that we are testing/supporting that functionality.

Currently I do not have a working release 1 or 1.5 to test this with, but
the following "should" work for multiple parameters:

<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) International Business Machines Corporation, 2002, 2003. (c)
University of Edinburgh 2002, 2003.-->
<!-- See OGSA-DAI-Licence.txt for licencing information.-->
<GridDataServiceScript>
 <Header>
    <ScriptName>Example 1</ScriptName>
    <Version>
      <Config>config</Config>
      <ScriptEnvironment>environment</ScriptEnvironment>
    </Version>
    <Originator>GSR of Originator</Originator>
  </Header>
  <Body>
      <Documentation>Select with data delivered with the response</
Documentation>
      <DefineParameter name="table">trial</DefineParameter>
      <Statement name="s1" dataResource="MyDataResource">
            SELECT name FROM <UseParameter reference="table"/> WHERE <
UseParameter reference="id"/>
      </Statement>
      <Delivery name="delivery">
            <Mechanism type="bulk"/>
            <Mode type="full"/>
            <From>s1</From>
            <To>response</To>
      </Delivery>
      <DefineParameter name="id">id = 0</DefineParameter>
      <Execute name="execute1">s1</Execute>

      <DefineParameter name="id">id = 1</DefineParameter>
      <Execute name="execute2">s1</Execute>

      <DefineParameter name="id">id = 2</DefineParameter>
      <Execute name="execute3">s1</Execute>
  </Body>
</GridDataServiceScript>

This should give a response of the form:

<GDSSR>
    <Header>
        <ScriptName>Example 1</ScriptName>
        <Version/>
    </Header>
    <Body>
        <Response>
            <Status>
                [GridDataServiceScript:Example 1] - finished execution
            </Status>
            <Result name="execute1">
                <!-- results for the first execute -->
            </Result>
            <Result name="execute2">
                <!-- results for the second execute -->
            </Result>
            <Result name="execute3">
                <!-- results for the third execute -->
            </Result>
        </Response>
    </Body>
</GDSSR>

As I said I have been unable to test this. However as one of the tests run
against ogsadai as part of our testing covers almost exactly this query you
shouldn't have a problem.

--
George Hicken
hickeng@uk.ibm.com
                                                                                                                                       
                      "Shishir S.                                                                                                      
                      Bharathi"                To:       users@ogsadai.org.uk                                                          
                      <shishir@ISI.EDU>        cc:                                                                                     
                      Sent by:                 Subject:  Need help with ogsadai scripts                                                
                      owner-users@ogsad                                                                                                
                      ai.org.uk                                                                                                        
                                                                                                                                       
                                                                                                                                       
                      27/03/2003 23:13                                                                                                 
                                                                                                                                       
                                                                                                                                       
Hi,
      I recently posted a message asking how to include more than 1
statement in an ogsadai script. Well, I kinda had to figure out how to do
that for myself. But i now have several questions I'm hoping someone can
answer.
1.
I had to include a <Delivery> and <Execute> element for each <Statement>
that I had. So my script looks like
<Statement1>
<Delivery1>
<Execute1>
<Statement2>
<Delivery2>
<Execute2>
and so on.
See the attachment for an example
I tried out various combinations trying to make do with only one
<Delivery> and <Execute> but this does not seem to be possible.
With some cases, the script is executed but only one of the results show
up. In other cases, I get weird exceptions.
The Ogsadai Grid Data Service documentation says that an <Execute> will
result in the execution of all activities from the named statement upto
but not including the Execute element itself.
So why doesn't
<Statement1>
<Statement2>
<Statement3>
<Delivery>
<Execute 1>
or maybe
<Statement1>
<Delivery1>
<Statement2>
<Delivery2>
<Execute 1>
result in the execution of all the statements ?
2. Even when I got it to work, I couldn't use <UseParameter> in the
statement. This results in
      uk.org.ogsadai.wsdl.GridDataServiceSystemException:
     <description>SystemException whilst running script:
java.lang.NullPointerException</description>
Why is this ? (Using <UseParameter reference="table"/> in the example
script in statement s1 will cause this. But if I use it in statement s2
and not in s1, it works fine. Strange.)
Duplicating the list of <DefineParameter>s for each statement doesn't help
either. Doesn't seem to be the right way to do things anyway.
3. The above behavior has made me rethink how I want to use ogsadai
scripts in my application. I'm going to be running the same basic script
with different values many times. The GDS document says I can submit the
same script with different parameters. Can someone give me some examples
on how I can do this ?
4. I was also wondering if I could use the concept of PredefinedScript in
the GDS-Config to do something like this. Does anyone have information on
whether this is possible ?
Maybe the ogsadai team should consider including examples of these into
the documentation. Most uses of ogsadai will include use of more complex
scripts than the simple examples provided. And it does not seem easy to
figure out how to achieve that easily from the documentation.
Thanks in advance for anyone who might be able and willing to help.
Shishir
#### new.xml has been removed from this note on March 28 2003 by George
Hicken1

Date view Thread view Subject view Author view Attachment view