Appendix H. Activities in OGSA-DAI 3.0

H.1. Activities in OGSA-DAI 3.0
H.2. Block activities
H.2.1. ByteArraysResize
H.2.2. CharArraysResize
H.2.3. ControlledRepeat
H.2.4. ListConcatenate
H.2.5. ListControlledRepeat
H.2.6. ListMultiply
H.2.7. ListRemove
H.2.8. Split
H.2.9. Tee
H.3. Delivery activities
H.3.1. DeliverToGFTP
H.3.2. DeliverToRequestStatus
H.3.3. ObtainFromGFTP
H.3.4. ReadFromDataSink
H.3.5. WriteToDataSource
H.3.6. ObtainFromDataSource
H.3.7. DeliverToDataSink
H.3.8. ObtainFromFTP
H.3.9. DeliverToFTP
H.3.10. DeliverToSMTP
H.4. File activities
H.4.1. ListDirectory
H.4.2. ReadFromFile
H.5. Management activities
H.5.1. CreateDataSink
H.5.2. CreateDataSource
H.5.3. CreateResourceGroup
H.6. Relational activities
H.6.1. ExtractTableSchema
H.6.2. GetAvailableTables
H.6.3. SQLBag
H.6.4. SQLBulkLoadTuple
H.6.5. SQLParameterisedQuery
H.6.6. SQLParameterisedUpdate
H.6.7. SQLQuery
H.6.8. SQLResilient
H.6.9. SQLUpdate
H.7. Transformation activities
H.7.1. CSVToTuple
H.7.2. TupleSimpleMerge
H.7.3. TupleSplit
H.7.4. TupleProjection
H.7.5. TupleToCSV
H.7.6. TupleToWebRowSetCharArrays
H.7.7. WebRowSetCharacterDataToTuple
H.7.8. XSLTransform
H.8. Utility activities
H.8.1. Echo
H.8.2. HashCode
H.8.3. ReadString
H.8.4. Sleep
H.8.5. Timestamp
H.9. XMLDB activities
H.9.1. XMLListCollections
H.9.2. XMLListResources
H.9.3. XPathQuery
H.9.4. XQuery
H.10. Status of activities in OGSA-DAI 3.0

H.1. Activities in OGSA-DAI 3.0

The complete list of activities shipped with OGSA-DAI and their status can be seem at the foot of this page in Section 4.1.6, “Status of activities in OGSA-DAI 3.0”. As described there, not all activities as yet have associated user documentation. You are directed to the activity specification document (Karasavvas, K. Atkinson, M.P. and Hume, A.C. OGSA-DAI - Redesigned and New Activities. http://www.ogsadai.org.uk/documentation/ogsadai3.0/RedesignedAndNewActivitiesV1.9.pdf), the JavaDoc of both client and server-side activity classes for guidance. If these are not adequate then please do contact the OGSA-DAI team (see Appendix B, Help and support) for assistance.

H.2. Block activities

H.2.1. ByteArraysResize

Summary:

  • This activity takes in a list of byte arrays and resizes them to a specific size.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ByteArraysResize.
  • Server class: uk.org.ogsadai.activity.block.ByteArraysResizeActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.ByteArraysResize.

Inputs:

  • data: types [byte[]]. Conditions: Required.
  • sizeInBytes: types Integer. Conditions: Required, must be greater than 0.

Outputs:

  • result: types [byte[]].

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity takes in a list of byte arrays and resizes them to a specific size which is specified by the parameter sizeInBytes. The input list can contains arrays of varying lengths. This activity is useful for service to service communication. Refer to Chapter 22, Best practice for more information about data formats, delivery options and performance.

H.2.2. CharArraysResize

Summary:

  • This activity takes in a list of char arrays and resizes them to a specific size.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.CharArraysResize.
  • Server class: uk.org.ogsadai.activity.block.CharArraysResizeActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.CharArraysResize.
    [Caution]Caution

    The client toolkit class released with OGSA-DAI 3.0 contains some incorrectly named methods in the OGSA-DAI 3.0 releases. The correct names will be added in a later release or patch and the incorrect names will be deprecated. The method addArraySizeInput should be called addSizeInChars. The method connectArraySizeInput should be called connectSizeInCharsInput. The method getOutput should be called getResultOutput.

Inputs:

  • data: types [char[]]. Conditions: Required.
  • sizeInChars: types Integer. Conditions: Required, must be greater than 0.

Outputs:

  • result: types [char[]].

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity takes in a list of char arrays and resizes them to a specific size which is specified by the parameter sizeInChars. The input list of can contain arrays of varying lengths. This activity is useful for service to service communication. Refer to Chapter 22, Best practice for more information about data formats, delivery options and performance.

H.2.3. ControlledRepeat

Summary:

  • This activity repeats the value of its first stream input as many times as the second input is available.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ControlledRepeatActivity.
  • Server class: uk.org.ogsadai.activity.block.ControlledRepeatActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.ControlledRepeat.

Inputs:

  • repeatedInput: [ ... [ java.lang.Object ] ... ] , any granularity. Conditions: Required.
  • input: [ ... [ java.lang.Object ] ... ], any granularity. Conditions: Required.

Outputs:

  • repeatedOutput: types [ ... [ java.lang.Object ] ... ] . Constraints: none.
  • output: types java.lang.Object. Constraints: none.

Configuration parameters: none.

Activity input/output ordering:

  • The value from the repeated input is read in full (until no more data is available) before the other input is read and any output is written.

Activity contracts: none.

Behaviour:

  • This activity accepts two inputs, the first being a value that we want to repeat (repeatedInput) and the second (input) is a stream of values that controls the number of repeats. For every available value in the second input the first input value is repeated.
  • The repeated input may be a simple value, for example a string "Repeat this", or a list, for example [a, b, c, d, e], or it may even be a nested list, for example a list of lists such as [[a, b, c], [c, d], [e, f, g, h]]. It will always be treated as a single value which is then repeated.
  • If the (non-repeated) input is a stream of simple values, for example a, b, c, d, e, f, g, the repeated input will be repeated for each value.
  • If the (non-repeated) input is a stream of lists, for example [a, b, c], [d, e, f], [g, h], the repeated input value will be repeated for each list.

H.2.4. ListConcatenate

Summary:

  • This activity concatenates all the input lists to one output list.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ListConcatenate.
  • Server class: uk.org.ogsadai.activity.block.ListConcatenateActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.ListConcatenate.

Inputs:

  • input: types [java.lang.Object]. Conditions: not optional, must have at least two or more entries.
  • partial: type java.lang.Boolean. Conditions: optional, defaults to false.
    [Warning]Warning

    There is a bug in the implementation of ListConcatenate when operating in partial mode. If all the inputs are in error the activity will enter into an infinite loop. The next release of OGSA-DAI will contain an improved implementation of this activity.

Outputs:

  • output: types [java.lang.Object].

Configuration parameters: None.

Activity input/output ordering: None

Activity contracts: None

Behaviour:

  • This activity takes a number of list input(s) and concatenates their contents into one list output. It will switch to the next input after reading all available blocks from the current input. Input partial specifies whether it is considered an error if some of the inputs are unavailable.
  • We assume that we concatenate similar objects; if inputs contain metadata those would represent the same entities, thus we can keep the metadata of only the first available metadata object for the output.
  • This is a simplified version of the activity; input granularity could be used to generalise it as seen in other ListXXX block activities.

H.2.5. ListControlledRepeat

Summary:

  • Repeats the value of its first input as a list as many times as the second list input is available
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ListControlledRepeat.
  • Server class: uk.org.ogsadai.activity.block.ListControlledRepeatActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.ListControlledRepeat.

Inputs:

  • repeatedInput: types [ ... [ java.lang.Object ] ... ]. Conditions: Required.
  • input: types [ ... [ java.lang.Object ] ... ]. Conditions: Required.
  • granularity: type java.lang.Integer. Conditions: Optional. Default is 1.

Outputs:

  • repeatedOutput: type java.lang.Object.
  • output: type java.lang.Object.

Configuration parameters: none.

Activity input/output ordering:

  • In each iteration, first a value is read from input repeatedInput (which can be a single object, a list of objects, or a nested list), then an integer is read from input granularity and finally a value is read from input input (which again can be a single object, a list of objects, or a nested list).

Activity contracts: none.

Behaviour:

  • As for ControlledRepeat, this activity repeats a value on the repeated input as many times as there are values from the control input. It can also operate in different granularities, e.g. operate on the elements inside a list. Input granularity specifies at what level the activity will operate. More precisely the activity will operate at the input’s granularity minus granularity.
  • The default granularity is 1, thus for list input(s) it will operate on the elements inside the list.
  • For example, if the repeated input is 1 and the input is [A, B], [C, D, E], then the repeated output is [1, 1], [1, 1, 1].
  • For example, if the repeated input is 1, 2 and the input is [[A, B], [C]], [[D, E, F], [G], [H, I]] then the repeated output is [[1, 1]], [2, 2, 2]].
  • For example, if granularity is 2, the repeated input is 1 and the input is [[A, B], [C, D, E], [F, G]] then the repeated output is [[1, 1], [1, 1, 1], [1, 1]].

H.2.6. ListMultiply

Summary:

  • This activity computes the cartesian product of the two input lists and produces a set of pairs each of which is split across two outputs.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ListMultiply.
  • Server class: uk.org.ogsadai.activity.block.ListMultiplyActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.ListMultiply.

Inputs:

  • input1: types [java.lang.Object]. Conditions: required.
  • input2: types [java.lang.Object]. Conditions: required.

Outputs:

  • output1: types [java.lang.Object].
  • output2: types [java.lang.Object].

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • Accepts two lists as its two inputs and produces two list outputs. It calculates the cartesian product of the two input lists and produces a set of pairs each of which is split into the two outputs. List markers are retained to differentiate between the output lists since we can stream multiple lists to the two inputs
  • This activity could be extended to accept n inputs and produce n outputs if the need arises.
  • Note that the cartesian product is always applied according to the order of the inputs.
  • If the input lists contain metadata blocks these are just passed on to the output lists and never repeated.

H.2.7. ListRemove

Summary:

  • This activity reduces the granularity of its input.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ListRemove.
  • Server class: uk.org.ogsadai.activity.block.ListRemoveActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.ListRemove.

Inputs:

  • input: types [[… java.lang.Object ]]…. Conditions: Required.

Outputs:

  • output: types [… java.lang.Object ]….

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • Reduces the granularity of its input by one. The granularity of input cannot be less than one.
  • For simplicity it currently reduces granularity by one.
  • It can be generalised by adding a granularity input that specifies the level of reduction.
  • If the output granularity is 0 then the metadata block can be omitted. However, that is not really required for the cases were metadata is currently used (Tuple lists and byte array lists). The data, after list removal, would not be a recommended stream anyway!

H.2.8. Split

Summary:

  • This activity outputs input values to one output at a time.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.Split.
  • Server class: uk.org.ogsadai.activity.clock.SplitActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.Split.

Inputs:

  • input: types [… java.lang.Object ]…. Conditions: none.

Outputs:

  • output: types [… java.lang.Object ]…. Constraints: must have at least two or more objects.

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • Split accepts blocks as its input and sends each block to one output in order. The ith block goes to the output n, where n is n modulo the number of outputs plus one. For example for two outputs block1 goes to the first output, block2 to the second, block3 to the third and so on. If input has granularity of, say 1, then the whole list would go to one output at a time, i.e. operates per logical block.
  • Metadata are being passed separately as a block preceding the data blocks; this activity needs to keep track of this since it sends data blocks through different outputs – to make sure that the metadata are sent again to the second, etc. outputs.
  • Consider the inputs “md, d1, d2, d3, d4” and that split has three outputs: md will be recognised as a metadata block and stored, md will be forwarded to 1st output, d1 will be forwarded to 1st output, d2 will be read and has to go to the 2nd output but the latter also needs the metadata so md will also be sent again to 2nd output then d2 will be sent to 2nd output, then d3 will be read and that has to go to the 3rd output but the latter also needs the metadata so md will be sent to 3rd output and then d3 will be sent to 3rd output, d4 will be read and that has to go to the 1st output where we have already sent an md so d4 will be sent to 1st output.

H.2.9. Tee

Summary:

  • This activity copies its input values to all of its outputs.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.Tee.
  • Server class: uk.org.ogsadai.activity.block.Tee.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.block.Tee.

Inputs:

  • input: types [ ... [ java.lang.Object ] ... ]. Conditions: Required.
  • clone: types java.lang.Boolean. Conditions: Optional, it defaults to false if not present.

Outputs:

  • output: types [ ... [ java.lang.Object ] ... ]. Constraints: the multiplicity of this output must be at least two

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • Tee accepts any block as its input and sends this block to all its outputs. By default a reference to the same object is written to the output. When the clone parameter is set to true, activity clones the input object for each output and writes those copies to the outputs.
  • List markers are not cloned even if clone is set to TRUE.
  • Any other objects must support cloning if cloning is set to TRUE.

H.3. Delivery activities

H.3.1. DeliverToGFTP

Summary:

  • This activity delivers data to files on a remote Grid FTP server.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.DeliverToGFTP.
  • Server class: uk.org.ogsadai.activity.delivery.DeliverToGFTPActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToGFTP.
  • Applicable resources: None.

Inputs:

  • host: type java.lang.String. Conditions: the host and port number of the Grid FTP server seperated by a ':' character, for example "gftp.server.myproject.org:2811".
  • filename: type java.lang.String. Conditions: name of the file to write to on the Grid FTP server.
  • data: types
    • list of byte[], or
    • list of char[], or
    • java.sql.Blob, or
    • java.sql.Clob.
    Conditions: The data to be send to the Grid FTP server. Any character data will be converted to binary data using UTF-8 encoding.
  • passiveMode: type java.lang.Boolean. Conditions: Optional input used to specify if passive mode should be used. The default value is Boolean.FALSE which specifies that passive mode should not be used.
  • append: type java.lang.Boolean. Conditions: Optional input used to specify if the data should be appended to any existing file with the specified name. The default value is Boolean.FALSE which specifies that the data should overwrite any existing data rather than append to it.
  • authorization: type java.lang.String. Conditions: Optional input used to specify how the activity should authorize the Grid FTP server. If the value is "HOST" then host authorization is used. If the value if "SELF" then self authorization is used. If self authorization is used the Grid FTP server must be running with the same identity as the user that submitted the workflow to OGSA-DAI. Any other value is taken to be the expected identity of the Grid FTP sever and it is used to provide identity authorization. The default value is to use host authorization.

Outputs:

  • None.

Activity input/output ordering:

  • If the data input contains list of byte[] or char[] objects then the activity will read all one value from each of the other inputs first and then stream through the whole list writing each data block to the Grid FTP server in turn.

Activity contracts:

  • None.

Behaviour:

  • Uses the Grid FTP protocol to send data to files on a remote Grid FTP server.
  • This activity requires the user's credential when contacting the Grid FTP server. It is therefore essential that the user delegates the credential to the Grid FTP server. This can be done using message level secure conversation and specifying either full or limited delegation.

H.3.2. DeliverToRequestStatus

Summary:

  • A delivery option which uses a request status as a target for returning results.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.DeliverToRequestStatus.
  • Server class: uk.org.ogsadai.activity.delivery.DeliverToRequestStatus.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToRequestStatus.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • input: types
    • java.util.Calendar
    • java.util.Date
    • java.lang.String
    • java.lang.Double
    • java.lang.Float
    • java.lang.Long
    • java.lang.Integer
    • java.lang.Boolean
    • char[]
    • byte[]
    • uk.org.ogsadai.activity.io.ControlBlock

Outputs:

  • None.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A

Activity contracts:

  • None

Behaviour:

  • The DeliverToRequestStatus activty takes the output from an activity and writes this output to a request status. The request status will then be read by the presentation layer which will do the necessary operations to transfer the results back to the client. In the case of the request status, this will often be done using SOAP. DeliverToRequestStatus allows input of the Java types listed. If a type which is not recognised by the activity is encountered, the object will be written as a String to the request status.
  • In the presentation layers, the request status will be converted from a Java format to a transmission format, in the case of web service-based presentation layers this would be a SOAP format. Below is an example of a SOAP response for an activity feeding into a DeliverToRequestStatus activity. Each data value, including list begin and end is treated as a seperate data item. As noted below this could pose problems for performance in a deployed system.
  • <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                         xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
    <soapenv:Header>
    <wsa:MessageID soapenv:mustUnderstand="0">uuid:920d2ac0-4f1b-11dc-afc8-fb84f721f326</wsa:MessageID>
    <wsa:To soapenv:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
    <wsa:Action soapenv:mustUnderstand="0">http://ogsadai.org.uk/namespaces/2007/04/service/execution/GTDataRequestExecutionServicePortType/executeResponse</wsa:Action>
    <wsa:From soapenv:mustUnderstand="0" xmlns:ns1="http://ogsadai.org.uk">
    <wsa:Address>http://localhost:8090/wsrf/services/DataRequestExecutionService</wsa:Address>
    <wsa:ReferenceProperties>
    <ns1:ResourceID soapenv:mustUnderstand="0" xmlns:ns1="http://ogsadai.org.uk" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">DataRequestExecutionResource</ns1:ResourceID>
    </wsa:ReferenceProperties>
    </wsa:From>
    <wsa:RelatesTo RelationshipType="wsa:Reply" soapenv:mustUnderstand="0">uuid:91f2ec00-4f1b-11dc-90e8-fadf8dc8bb2d</wsa:RelatesTo>
    </soapenv:Header>
    <soapenv:Body>
    <executeResponse xmlns="http://ogsadai.org.uk/namespaces/2007/04/service/execution">
    <ns1:requestStatus xmlns:ns1="http://ogsadai.org.uk/namespaces/2007/04/types">
    <ns1:requestDetails id="ogsadai-11482d01803" status="COMPLETED"/>
    <ns1:activity instanceName="uk.org.ogsadai.DeliverToRequestStatus-ogsadai-1148350a3e6" status="COMPLETED"/>
    <ns1:activity instanceName="uk.org.ogsadai.SQLQuery-ogsadai-1148350a3e2" status="COMPLETED"/>
    <ns1:activity instanceName="uk.org.ogsadai.TupleToCSV-ogsadai-1148350a3e4" status="COMPLETED"/>
    <ns1:result activityInstanceName="uk.org.ogsadai.DeliverToRequestStatus-ogsadai-1148350a3e6" resultName="result">
    <ns1:data>
    <ns1:listBegin/>
    </ns1:data>
    <ns1:data>
    <ns1:charArray>
        <![CDATA[23,TestAName,44 Calder Street,03403829]]>
    </ns1:charArray>
    </ns1:data>
    <ns1:data>
    <ns1:listEnd/>
    </ns1:data>
    </ns1:result>
    </ns1:requestStatus>
    <requestID>ogsadai-11482d01803</requestID>
    </executeResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    
  • Delivery via a request status, where the results are contained in a SOAP message has performance penalties for large result sets and as such should be used with caution for large operations. Refer to Chapter 22, Best practice for more information about this and other data delivery options.

H.3.3. ObtainFromGFTP

Summary:

  • This activity obtains data from files on a remote Grid FTP server.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.ObtainFromGFTP.
  • Server class: uk.org.ogsadai.activity.delivery.ObtainFromGFTPActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.ObtainFromGFTP.
  • Applicable resources: None.

Inputs:

  • host: type java.lang.String. Conditions: the host and port number of the Grid FTP server seperated by a ':' character, for example "gftp.server.myproject.org:2811".
  • filename: type java.lang.String. Conditions: name of the file to read from the Grid FTP server.
  • passiveMode: type java.lang.Boolean. Conditions: Optional input used to specify if passive mode should be used. The default value is Boolean.FALSE which specifies that passive mode should not be used.
  • authorization: type java.lang.String. Conditions: Optional input used to specify how the activity should authorize the Grid FTP server. If the value is "HOST" then host authorization is used. If the value if "SELF" then self authorization is used. If self authorization is used the Grid FTP server must be running with the same identity as the user that submitted the workflow to OGSA-DAI. Any other value is taken to be the expected identity of the Grid FTP sever and it is used to provide identity authorization. The default value is to use host authorization.

Outputs:

  • data: list of byte[] objects that contain the data read from the file at the Grid FTP server.

Activity input/output ordering:

  • One value is read from each input and then the data read from the server is written in streamed to the output.

Activity contracts:

  • None.

Behaviour:

  • Uses the Grid FTP protocol to obtain data from files on a remote Grid FTP server.
  • This activity requires the user's credential when contacting the Grid FTP server. It is therefore essential that the user delegates the credential to the Grid FTP server. This can be done using message level secure conversation and specifying either full or limited delegation.

H.3.4. ReadFromDataSink

Summary:

  • This activity obtains data which has be stored in a Data Sink Resource.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.ReadFromDataSink.
  • Server class: uk.org.ogsadai.activity.delivery.ReadFromDataSinkActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.ReadFromDataSink.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.datasink.DataSinkResource

Inputs:

  • None.

Outputs:

  • output: java.lang.Object that contain the data read from the Data Sink Resource targetted.

Activity input/output ordering:

  • One value is read from the Data Sink Resource and output to the next activity in the workflow.

Activity contracts:

  • None.

Behaviour:

  • The ReadFromDataSink activity will read the blocks of data stored in the Data Sink Resource until it exhausts the resource of data.
  • Normal operation of this activity will results in a stream of objects being written to the output from this activity to be used as input to another activity. This will continue until the data in the resource has all been read and a ControlBlock is encountered indicating no more data is available.
  • Should an error be encountered, this can cause the activity to close the pipe connecting to the workflow and a PIPE_CLOSED_DUE_TO_PRODUCER_ERROR error will be introduced to the workflow and returned to the client. Data read before the error is encountered will be available to the subsequent activities.

H.3.5. WriteToDataSource

Summary:

  • This activity will write its input to a Data Source Resource.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.WriteToDataSource.
  • Server class: uk.org.ogsadai.activity.delivery.WriteToDataSourceActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.WriteToDataSource.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.datasource.DataSourceResource

Inputs:

  • input: type: java.lang.Object

Outputs:

  • None.

Activity input/output ordering:

  • An value is read from the input as an Object and written to the targetted Data Source Resource.

Activity contracts:

  • None.

Behaviour:

  • The activity will read input as java.lang.Object and store these in a Data Source Resource.
  • Normal operation of this activity will result in a stream of objects being written to the Data Source Resource from the input of this activity. This will continue until the data in the input has all been read and a ControlBlock is encountered indicating no more data is available.
  • Should an error be encountered, this will be written to the Data Source Resource and will be flagged in the Request Status as an error. Data written prior to the error will be accessible and the error will terminate the Data stream from the Data Source Resource upon retrieval.

H.3.6. ObtainFromDataSource

Summary:

  • This activity read the contents of a Data Source Resource, on either a local or remote OGSA-DAI, for use in a workflow.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.ObtainFromDataSource.
  • Server class: uk.org.ogsadai.activity.delivery.ObtainFromDataSourceActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.ObtainFromDataSource.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.datasource.DataSourceResource

Inputs:

  • url: type: java.lang.String: URL for Data Source Resource
  • resourceID: type: java.lang.String: Resource ID for Data Source Resource
  • mode: type: java.lang.String: Mode Type for Activity can have values: FULL/BLOCK.
  • numberOfBlocks: type: java.lang.Integer: Optional Input for Number of Blocks to read at a time.

Outputs:

  • data: type: java.lang.Object

Activity input/output ordering:

The inputs for this activity should be given in the following order.

  • url
  • resourceID
  • mode
  • numberOfBlocks: Note this is an optional input.

Activity contracts:

  • None.

Behaviour:

  • The activity will read input from a Data Source Resource and output the blocks read as Java Objects.
  • Normal operation of this activity will result in a Data Source Resource being accessed and its contents read and passed to the next stage of a workflow. The activity will read in one of two modes, FULL or BLOCK. This is specified as part of the workflow and activity setup. In FULL mode, the Data Source Resource will be read fully in one stage, whereas in BLOCK mode, a specified number of blocks will be read each time until the Resource has been exhausted.
  • The activity can return errors for several different types of processing and user mistakes. Firstly, an invalid URL for the Data Source Resource OGSA-DAI server, this will return an error stating there has been a problem with the URL.
  • Second, an invalid ResourceID which will return an error if the resource cannot be located.
  • An invalid read mode will cause an InvalidInputValueException to thrown.
  • If an negative number of blocks to be read is input, then an error will be returned stating this is invalid and must be corrected.
  • Other errors can be operational errors, such as read problems or invalid data in the Data Source Resource targetted.

H.3.7. DeliverToDataSink

Summary:

  • The activity will deliver its input data to a specified Data Sink Resource on an OGSA-DAI installation.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.DeliverToDataSink.
  • Server class: uk.org.ogsadai.activity.delivery.DeliverToDataSinkActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToDataSink.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.datasink.DataSinkResource

Inputs:

  • url: type: java.lang.String: URL for Data Source Resource
  • resourceID: type: java.lang.String: Resource ID for Data Source Resource
  • mode: type: java.lang.String: Mode Type for Activity can have values: FULL/BLOCK.
  • numberOfBlocks: type: java.lang.Integer: Optional Input for Number of Blocks to read at a time.
  • data: type: java.lang.Object: Data to be written to Data Sink Resource.

Outputs:

  • None.

Activity input/output ordering:

The inputs for this activity should be given in the following order.

  • url
  • resourceID
  • m
  • numberOfBlocks: Note this is an optional input.

Activity contracts:

  • None.

Behaviour:

  • DeliverToDataSink will take a series of objects from an Activity Output as input and write these objects to the specified Data Sink Resource, either on a local or remote OGSA-DAI installation.
  • Normal operation will mean that this activity will write to a Data Sink Resource until the data input has been exhausted. The targetted Data Sink Resource will store the data until it is accessed and retrieved.
  • There are two modes of opation, BLOCK and FULL. In BLOCK mode, each write operation to the Data Sink Resource will contain the number of blocks specified on the inputs. In FULL mode, the whole input to the DeliverToDataSink will be written to the Data Sink Resource at one time.
  • Errors in operation will return to the client the details of the error.
  • If an invalid URL is used as input this will return to the client as an Activity User Exception.
  • If an invalid ResourceID is used as input this will return to the client as an Resource Unknown Error.
  • Inputting a negative number of blocks will cause an Activity User Exception stating that the number of blocks should not be negative.
  • An invalid mode will return an Invalid Input Value Exception.
  • Other errors can occur which affect the operation of this Activity, these can be operational or data errors which information specific to the error will be returned.

H.3.8. ObtainFromFTP

Summary:

  • This activity will retrieve a specified file from FTP for input to a workflow.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.ObtainFromFTP.
  • Server class: uk.org.ogsadai.activity.delivery.ObtainFromFTPActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.ObtainFromFTP.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • filename: type: java.lang.String: target filename including path.
  • host: type: java.lang.String: Host URL including port.
  • passiveMode: type: java.lang.Boolean: Optional input indicating if FTP passive handshaking should be used. Default: false.

Outputs:

  • data: type: [byte[]]

Activity input/output ordering:

The inputs for this activity should be given in the following order.

  • filename
  • host
  • passiveMode

Activity contracts:

  • None.

Behaviour:

  • The activity takes a host URL with port and a filename including the path to the file and will download the file from the FTP server. The output will be a list of byte[].
  • The input passiveMode specifies if FTP passive handshaking should be used. By default this is set to false.
  • ActivityProcessingException will be thrown if an I/O or FTP connection error is encountered.

H.3.9. DeliverToFTP

Summary:

  • This activity will deliver the output of an activity to a specified file on an FTP Server.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.DeliverToFTP.
  • Server class: uk.org.ogsadai.activity.delivery.DeliverToFTPActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToFTP.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • filename: type: java.lang.String: target filename including path.
  • host: type: java.lang.String: Host URL including port.
  • passiveMode: type: java.lang.Boolean: Optional input indicating if FTP passive handshaking should be used. Default: false.
  • data: type: java.io.InputStream: Binary input to be uploaded.

Outputs:

  • None.

Activity input/output ordering:

The inputs for this activity should be given in the following order.

  • filename
  • host
  • data
  • passiveMode

Activity contracts:

  • None.

Behaviour:

  • The activity takes a host URL with port and a filename including the path to the file and will upload the input data to the FTP server.
  • The input passiveMode specifies if FTP passive handshaking should be used. By default this is set to false.
  • ActivityProcessingException will be thrown if an I/O or FTP connection error is encountered.

H.3.10. DeliverToSMTP

Summary:

  • This activity will deliver the output of an activity as emails to a list of recipients via a SMTP server.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.DeliverToSMTP.
  • Server class: uk.org.ogsadai.activity.delivery.DeliverToSMTPActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToSMTP.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • from: type: java.lang.String: sender account address.
  • to: type: uk.org.ogsadai.activity.io.ListIterator: List of recipient email addresses.
  • subject: type: java.lang.String: Email subject line
  • data: type: java.io.Reader: Reader for data to be sent.

Outputs:

  • None.

Configuration parameters:

  • dai.smtp.server: Constraints: A valid SMTP server address for the OGSA-DAI activity to use.

Activity input/output ordering:

The inputs for this activity should be given in the following order.

  • from
  • to
  • subject
  • data

Activity contracts:

  • None.

Behaviour:

  • The activity takes a sender address, a list of target email addresses, a subject line and data to send to the recipients. The activity will send the data to the list of recipients using the SMTP server taken from the configuration parameters. FTP server.
  • The input to is a ListIterator for a list of valid email addresses to send to.
  • ActivityProcessingException will be thrown if an I/O or SMTP connection error is encountered.

H.4. File activities

H.4.1. ListDirectory

Summary:

  • This activity allows you to list the contents of a directory under a file system resource.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ListDirectory.
  • Server class: uk.org.ogsadai.activity.file.ListDirectoryActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.file.ListDirectory.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.file.FileAccessProvider

Inputs:

  • directory: types String Conditions: Optional, defaults to '\'
  • includePath: types Boolean Conditions: Optional, defaults to true.
  • recursive: types Boolean Conditions: Optional, defaults to false

Outputs:

  • data: types String[]

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity is used to list the contents of a directory within a file system resource.
  • If no directory name is passed the root directory will be used.
  • By default the full path with in the resource is returned. Passing false for the includePath parameter will result in the relative path being returned.
  • By default sub-directories are not recursively listed, however passing true for the recursive parameter caused the sub-directories to be recursed.

H.4.2. ReadFromFile

Summary:

  • This activity can read the contents of a file in a file system resource.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.ReadFromFile.
  • Server class: uk.org.ogsadai.activity.file.ReadFromFileActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.file.ReadFromFile.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.file.FileAccessProvider

Inputs:

  • file: types String. Conditions: Required.
  • offset: types Long. Conditions: Optional, defaults to 0, namely the start of the file.
  • length: types Long. Conditions: Optional, must be greater than 0, except -1 which indicates to read to the end of the file. Defaults to -1.

Outputs:

  • data: types [byte[]].

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity can read the content of a file stored in a fil system resource. The read offset and read length can be set. The default offset is 0, or the start of the file. The length of bytes to read can also be set, a value of -1 indicates to continue reading until the end of the file is reached, which is the default value for this input.

H.5. Management activities

H.5.1. CreateDataSink

Summary:

  • Creates a data sink that that can be used later for reading its data.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.CreateDataSink.
  • Server class: uk.org.ogsadai.activity.management.CreateDataSinkActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.management.CreateDataSink.

Inputs:

  • resourceId: type java.lang.String. Conditions: Optional input used to specify the ID of the data sink. If not provided, then the server generates randomly a unique one. If provided then it must be parsable into a valid uk.org.ogsadai.resource.ResourceID.

Outputs:

  • result: type java.lang.String - the ID of the data sink.

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity creates a data sink either based on the resource ID provided or by the server generating randomly a unique one. For each data sink created, its resource ID is written to the output.
  • Partial creation of data sinks may take place if an error occurs at any stage of processing.
  • An error will be returned to the client if the resource ID provided by the client is not a valid a uk.org.ogsadai.resource.ResourceID.
  • An error will be returned to the client if the resource ID provided by the client is already taken server-side by an existing resource.
  • An error will be returned to the client if an internal error occurs server-side that prevents the creation of the data sink.

H.5.2. CreateDataSource

Summary:

  • Creates a data source that that can be used later for writing its data.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.CreateDataSource.
  • Server class: uk.org.ogsadai.activity.management.CreateDataSourceActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.management.CreateDataSource.

Inputs:

  • resourceId: type java.lang.String. Conditions: Optional input used to specify the ID of the data source. If not provided, then the server generates randomly a unique one. If provided then it must be parsable into a valid uk.org.ogsadai.resource.ResourceID.

Outputs:

  • result: type java.lang.String. ID of the data source.

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity creates a data source either based on the resource ID provided by the client or by the server generating randomly a unique one. For each data source created, its resource ID is written to the output.
  • Partial creation of data sources may take place if an error occurs at any stage of processing.
  • An error will be returned to the client if the resource ID provided by the client is not a valid a uk.org.ogsadai.resource.ResourceID.
  • An error will be returned to the client if the resource ID provided by the client is already taken server-side by an existing resource.
  • An error will be returned to the client if an internal error occurs server-side that prevents the creation of the data source.

H.5.3. CreateResourceGroup

Summary:

  • Creates a resource group data resource that relates together resources to be used by activities that need to target multiple resources (e.g. SQLBag).
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.CreateResourceGroup.
  • Server class: uk.org.ogsadai.activity.management.CreateResourceGroupActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.management.CreateResourceGroup.

Inputs:

  • resourceIds: type [java.lang.String]. IDs of the resources to be members of the resource group. Each must be parsable into a valid uk.org.ogsadai.resource.ResourceID.
  • resourceGroupId: type [java.lang.String]. Conditions: optional (server generated). If provided then it must be parsable into a valid uk.org.ogsadai.resource.ResourceID.

Outputs:

  • output: types java.lang.String. ID of the resource group.
    [Warning]Warning

    This output in incorrectly named. It should be called 'result'. This will be changed in the next release of OGSA-DAI.

Configuration parameters: none.

Activity input/output ordering: none.

Activity contracts: none.

Behaviour:

  • This activity simply creates a resource group data resource that stores a collection of IDs related according to some client-specific criteria to be used by activities that need to target multiple resources (e.g. SQLBag). The ID of the resource group can be requested by the client or auto-generated by the server.

H.6. Relational activities

H.6.1. ExtractTableSchema

Summary:

  • This activity returns the schema information of a table.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.ExtractTableSchema.
  • Server class: uk.org.ogsadai.activity.sql.ExtractTableSchemaActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.ExtractTableSchema.
  • Applicable resources: this activity can be applied to resources that implements the following interface:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider.

Inputs:

  • name: type java.lang.String. Conditions: none. This can be a pattern in which "%" matches any substring, "_" matches one character.
  • catalog: type java.lang.String. Conditions: optional.
  • schema: type java.lang.String. Conditions: optional.

Outputs:

  • data: types [TableMetaData]. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A.

Activity contracts:

  • None.

Behaviour:

  • Gets the requested table's schema. Certain input patterns can inquire for more than one table, thus the result could be a list. Defaults for catalog and schema are the currently used ones. If no tables are found an empty list will be returned.

H.6.2. GetAvailableTables

Summary:

  • This activity gets a list of the tables available from the database.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.GetAvailableTables.
  • Server class: uk.org.ogsadai.activity.sql.GetAvailableTablesActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.GetAvailableTables.
  • Applicable resources: this activity can be applied to resources that implements the following interface:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider.

Inputs:

  • None.

Outputs:

  • data: types [java.lang.String]. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A.

Activity contracts:

  • None.

Behaviour:

  • [Gets a list available tables in exposed database.

H.6.3. SQLBag

Summary:

  • This activity sends an SQL query to a set of resources and combines all the results into a single result tuple list. The set of resources on which the query should be executed is specified by the resource group resource to which this activity is targeted.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.SQLBag.
  • Server class: uk.org.ogsadai.activity.sql.SQLBagActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLBag.
  • Applicable resources: this activity can be applied to resources that implement the following interface:
    • uk.org.ogsadai.resource.ResourceAccessor.ResourceGroupProvider.
    Additionally all of the resources within the resource group must support an activity called uk.org.ogsadai.SQLQuery than can be used to execute an SQL query on the resource.

Inputs:

  • expression: type java.lang.String. Conditions: must contain a valid SQL query expression.
  • timeout: type java.lang.Integer. Conditions: number of ms for the query to time out. This is optional with the default value of 10000ms if not specified.
    [Warning]Warning

    The inclusion of this input was an error. Timeouts within SQLBag are now regarded as a bad idea. This input will be removed in the next release of OGSA-DAI which will contain a better SQLBag activity implementation. Until that release it is recommended that you set the timeout to be sufficiently high so that it never has an impact, for example java.lang.Integer.MAX_VALUE.

    If you are planning to make extensive use of SQLBag before the next release of OGSA-DAI then please contact the OGSA-DAI team and we will be happy to advise you.

Outputs:

  • data: types [MetadataWrapper(TupleMetadata),uk.org.ogsadai.tuple.Tuple,...]. Constraints: none.
Configuration parameters:
  • No.

Activity input/output ordering:

  • N/A.

Activity contracts:

  • uk.org.ogsadai.activity.contract.SQLQuery
  • uk.org.ogsadai.activity.contract.SQLBag

Behaviour:

  • Sends expression to be executed on each resource in the resource group. Merges the result into single tuple list. The result tuples they will be in an arbitrary order depending on when data resources responded and the order in which they did so.
  • All the resources to which the query expression is sent are expected to return tuples with the same metadata. The metadata block written to the output will be formed by the result from a single resource, it is assumed the data obained from other resources also conforms to this metadata.
  • The activity tries to be robust to any failures when executing the query on a resource in the resource group. A warning will be logged to the request status and the activity will simply carry on collecting tuples from the other resources.
  • SQLBag internally calls uk.org.ogsadai.SQLQuery activities to execute the query on the resources within the resource group. Internally the result streams from these activities are merged using a uk.org.ogsadai.ListConcatenate activity.
  • For an example of using SQLBag see Section 23.1, “How to execute an SQL query across multiple resources”.

H.6.4. SQLBulkLoadTuple

Summary:

  • This activity bulk loads relational data to a data resource
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.SQLBulkLoadTuple.
  • Server class: uk.org.ogsadai.activity.sql.SQLBulkLoadTupleActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLBulkLoadTuple.
  • Applicable resources: this activity can be applied to resources that implements the following interface:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider.

Inputs:

  • data: types [MetadataWrapper(TupleMetadata),uk.org.ogsadai.tuple.Tuple,...].. Conditions: TupleMetadata must conform to that expected in the target table..
  • tableName: type java.lang.String. Conditions: none.

Outputs:

  • result: type java.lang.Integer. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • Each table name on input tableName must be matched by an accompanying Tuple list on input data. Each pair of table name and Tuple list will produce one output.

Activity contracts:

  • None.

Behaviour:

  • Basic behaviour of the activity will require a valid table name on the targetted DataResource. For this table name, a tuple list should contain TupleMetadata and a series of Tuples to be inserted. Using the TupleMetadata and the table name, the activity will construct an SQL statement to insert the tuple values into the targetted resource and table. The activity output will the number of tuples which have been inserted as an integer value.
  • A RELATIONAL_ACTIVITY_SQL_EXCEPTION error will be raised in the event of an invalid tablename or invalid tuple column types are provided to the activity.

H.6.5. SQLParameterisedQuery

Summary:

  • Executes SQL queries with parameters on the target data resource and produces tuple lists as output.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.SQLParameterisedQuery.
  • Server class: uk.org.ogsadai.activity.sql.SQLParameterisedQueryActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLParameterisedQuery.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider

Inputs:

  • expression: Type java.lang.String. Conditions: must contain a valid SQL query expression.
  • parameters: lists of uk.org.ogsadai.tuple.Tuple. The first block in a list is an object of type uk.org.ogsadai.tuple.TupleMetadata.

Outputs:

  • data: lists of lists of uk.org.ogsadai.tuple.Tuple and corresponding uk.org.ogsadai.tuple.TupleMetadata, one tuple list per input expression.
Configuration parameters:
  • None.

Activity input/output ordering:

  • In each iteration the activity first reads one block from the expression input and then iterates through a complete list of tuples from the parameters input.
  • The number of input expressions must match the number of parameter lists.

Activity contracts:

  • uk.org.ogsadai.activity.contract.SQLQuery

Behaviour:

  • This activity accepts a sequence of SQL query expressions with corresponding parameters as input. The SQL expression may contain placeholders '?' into which the given parameter values are inserted at execution time.
  • In each iteration one input query is processed together with a list of parameters. For each tuple in the parameter list the query is executed on the target data resource and the results are placed in a tuple list with a metadata header block. Each iteration produces a list containing nested tuple lists for each parameter tuple.
  • Partial data may be produced if an error occurs at any stage of processing.
  • An ActivitySQLUserException is raised if there was an access error at the data resource such as syntax errors in the SQL expression or if the target table does not exist. It is also raised if the number of placeholders '?' in the SQL query expression do not match the number of parameters in the input tuple.
  • An ActivitySQLUserException is raised if the number of input SQL expressions does not match the number of input parameter lists.

H.6.6. SQLParameterisedUpdate

Summary:

  • Activity executes SQL updates statements using a parameter list of tuples on a target data resource and produces the resulting update counts as output.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.SQLParameterisedUpdate.
  • Server class: uk.org.ogsadai.activity.sql.SQLParameterisedUpdateActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLParameterisedUpdate.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider

Inputs:

  • expression: Type java.lang.String. Conditions: must contain a valid SQL update expression.
  • parameters: Type lists of uk.org.ogsadai.tuple.Tuples. Conditions: Ordering of Tuple columns must match that required by the expression.

Outputs:

  • result: lists of java.lang.Integer, one list per input expression.
Configuration parameters:
  • None.

Activity input/output ordering:

  • In each iteration the activity first reads one block from the expression input and then iterates through a complete list of tuples from the parameters input.
  • The number of input expressions must match the number of parameter lists.

Activity contracts:

  • None.

Behaviour:

  • This activity accepts a sequence of SQL update expressions with corresponding parameters as input. The SQL expression containing placeholders '?' will be prepared at the database and the given parameter values are inserted at execution time.
  • In each iteration one input update is processed together with a list of parameters. For each tuple in the parameter list the update is executed once on the target data resource and the resulting update count is written to the output. Each iteration produces a list containing an update count corresponding to each input parameter tuple.
  • An ActivitySQLUserException is raised if there was an access error at the data resource for example syntax errors in the SQL expression or if the target table does not exist. It is also raised if the number of placeholders '?' in the SQL query expression do not match the number of parameters in the input tuple.
  • An ActivitySQLUserException is raised if the number of input SQL expressions does not match the number of input parameter lists.

H.6.7. SQLQuery

Summary:

  • Executes SQL queries on the target data resource and produces tuple lists as output.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.SQLQuery.
  • Server class: uk.org.ogsadai.activity.sql.SQLQueryActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLQuery.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider

Inputs:

  • expression: Type java.lang.String. Conditions: must contain a valid SQL query expression.

Outputs:

  • data: lists of uk.org.ogsadai.tuple.Tuples with corresponding uk.org.ogsadai.tuple.TupleMetadata, one per input expression.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A

Activity contracts:

  • uk.org.ogsadai.activity.contract.SQLQuery

Behaviour:

  • This activity accepts a sequence of SQL query expressions as input and is targetted at a relational data resource. In each iteration one input query is processed by executing the query across the target data resource. The results of each iteration is a tuple list with a metadata header block.
  • Partial data may be produced if an error occurs at any stage of processing.
  • An ActivitySQLUserException is raised if there was an access error at the data resource such as syntax errors in the SQL expression or if the target table does not exist.

H.6.8. SQLResilient

Summary:

  • This activity tries to submit an SQL query to one of a set of resources. The activity will return the results from the first resource in the set that successfully returns a response. The set of resources on which the query may be executed is specified by the resource group resource to which this activity is targeted.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.SQLResilient.
  • Server class: uk.org.ogsadai.activity.sql.SQLResilientActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLResilient.
  • Applicable resources: this activity can be applied to resources that implement the following interface:
    • uk.org.ogsadai.resource.ResourceAccessor.ResourceGroupProvider.
    Additionally all of the resources within the resource group must support an activity called uk.org.ogsadai.SQLQuery than can be used to execute an SQL query on the resource.

Inputs:

  • expression: type java.lang.String. Conditions: must contain a valid SQL query expression.
  • timeout: type java.lang.Integer. Conditions: number of ms for the query to time out. This is optional with the default value of 10000ms if not specified.
    [Warning]Warning

    The inclusion of this input was an error. Timeouts within SQLResilient are now regarded as a bad idea. This input will be removed in the next release of OGSA-DAI which will contain a better SQLResilient activity implementation. Until that release it is recommended that you set the timeout to be sufficiently high so that it never has an impact, for example java.lang.Integer.MAX_VALUE.

    If you are planning to make extensive use of SQLResilient before the next release of OGSA-DAI then please contact the OGSA-DAI team and we will be happy to advise you.

Outputs:

  • data: types [MetadataWrapper(TupleMetadata),uk.org.ogsadai.tuple.Tuple,...]. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A.

Activity contracts:

  • uk.org.ogsadai.activity.contract.SQLQuery
  • uk.org.ogsadai.activity.contract.SQLResilient

Behaviour:

  • Returns the results of execution the SQL query on one of the resources in the resource group. The query is sent to each resource in the resource group in turn until one successfully responds.
  • The activity tries to be robust to any failures when executing the query on a resource in the resource group. If a failure occurs before any data is written to the output then a warning will be logged to the request status and the activity will simply try the next another resource. If a failure occurs after some data has been written to the output the activity will not try any other resources, instead that error will propagate through the workflow in the usual way.
  • SQLResilient internally calls uk.org.ogsadai.SQLQuery activities to execute the query on the resources within the resource group.

H.6.9. SQLUpdate

Summary:

  • Executes SQL updates on the target data resource and produces the resulting update counts as output.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.SQLUpdate.
  • Server class: uk.org.ogsadai.activity.sql.SQLUpdateActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.sql.SQLUpdate.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.jdbc.JDBCConnectionProvider

Inputs:

  • expression: Type java.lang.String. Conditions: must contain a valid SQL update expression.

Outputs:

  • result: type java.lang.Integer, one per input expression.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A

Activity contracts:

  • None.

Behaviour:

  • This activity accepts a sequence of SQL update expressions as input and is targetted at a relational data resource. In each iteration one input update is processed by executing the update on the target data resource. The results of each iteration is an update count which specifies the number of modified rows in the database.
  • An ActivitySQLUserException is raised if there was an access error at the data resource for example syntax errors in the SQL expression or if the target table does not exist.

H.7. Transformation activities

H.7.1. CSVToTuple

Summary:

  • Activity that converts lists of a CSV formatted input into lists of tuples.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.CSVToTuple.
  • Server class: uk.org.ogsadai.activity.transform.CSVToTupleActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.CSVToTuple.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • data: type: list of char[]. This is the actual CSV data.
    [Warning]Warning
    In release 3.0 the CSV data must contain a newline at the end of the final row. Without this newline the final row will be missed out or if there is only one row a error will occur. This bug has since been fixed and the fix will be included in the next release.
  • delimiter: type: java.lang.String Conditions: Optional input indicating what the delimiter is.The default value is ","
  • nullDataString: type: java.lang.String Conditions: Optional input indicating the representation of null value fields. The default value is "NULL".
  • headerIncluded: type: java.lang.Boolean Conditions: Optional input indicating whether the first line should be considered as header. The default value is Boolean.FALSE. If the first line is considered to be a header then the values in this line will be used to label the column names.
  • outputTypes: type: list of java.lang.Integer conditions: Optional input indicating the type of the fields of each column in order to provide more complete metadata in the result. The default value is uk.org.ogsadai.tuple.TupleTypes._STRING

Outputs:

  • result: type: list of char[]
Configuration parameters:
  • None

Activity input/output ordering:

  • None

Activity contracts:

  • None

Behaviour:

  • Normal behaviour of the CSVToTuple Activity is for the activity to receive as input a list of char arrays from another activity. Then this activity will transform them into a list of tuples using the CSV Configuration as set by the input parameters or their default values.
  • The output will start with a ListBegin and end with a ListEnd. Each line of output between these markers will be the output from a tuple of input. Since it is a list of tuples, the first block of the list will be a metadata block.
  • Altering the configuration will change the output, for example setting the headerIncluded to true will result the first line of the CSV to be considered as header rather than actual values. This will impact the construction of the tuple metadata.
  • In the case of an error occurring on the input, such as a premature pipe closure or failure, the activity will process up to that point and output everything up to the error. The error will then be propagated to the next activity and eventually returned in an error message to the client.
  • Various errors can occur while either getting the configuration parameters of the CSV format or while parsing it. These errors in result in corresponding exceptions to be thrown.

H.7.1.1. Example

This example shows how to use the CSVToTuple activity to convert a comma separated values (CSV) data file into a tuple list that can be used by other activities in OGSA-DAI. Assume we have file containing the following CSV data:

name,age,height
ally,37,1.5
ross,2,0.7
bob,20,1.4

The first line of this file is a header that specifies column names. The next three lines are data values. The name column contains text, the age column contains integers and the height column contains floating point numbers.

The following example code passes this CSV data as input to the TupleToCSV activity. The tuple list produced by the activity is then converted into XML Web Row Set format and returned in the request status. Finally the example code prints out the XML Web Row Set data . This is not the type of workflow one would normally execute but it is used in this example because converting the tuples to XML Web Row Set allows us easily read the tuple metadata so we can see what the activity has done. In practice output of the TupleToCSV activity would go as input to another activity that expects a tuple stream such as SQLParameterisedQuery or SQLBulkloadTuple. Also in practice the CSV data may not be passed to OGSA-DAI directly as an input from the client, instead it may be obtained from another activity such as ObtainFromFTP.

The example code is:

package uk.org.ogsadai.test.system.activity.transform;

import java.io.BufferedReader;
import java.io.Reader;
import java.io.StringReader;
import java.net.URL;

import uk.org.ogsadai.client.toolkit.DataRequestExecutionResource;
import uk.org.ogsadai.client.toolkit.PipelineWorkflow;
import uk.org.ogsadai.client.toolkit.RequestExecutionType;
import uk.org.ogsadai.client.toolkit.Server;
import uk.org.ogsadai.client.toolkit.ServerProxy;
import uk.org.ogsadai.client.toolkit.activities.delivery.DeliverToRequestStatus;
import uk.org.ogsadai.client.toolkit.activities.transform.CSVToTuple;
import uk.org.ogsadai.client.toolkit.activities.transform.TupleToWebRowSetCharArrays;
import uk.org.ogsadai.resource.ResourceID;
import uk.org.ogsadai.tuple.TupleTypes;

/**
 * Example client program using the CSVToTuple activity.
 *
 * @author The OGSA-DAI Project Team
 */
public class CSVToTupleExample
{
    public static void main(String[] args) throws Exception
    {
        // Reader to CSV data.  This could easily be a FileReader to read
        // the data from a file.
        String csvData = 
            "name,age,height\nally,37,1.5\nross,2,0.7\nbob,20,1.4\n";
        Reader reader = new StringReader(csvData);
        
        // Construct the CSVTuple activity
        CSVToTuple csvToTuple = new CSVToTuple();
        
        // Add the data
        csvToTuple.addData(reader);
        
        // Specify that the data has a header row.  This will be use to
        // form the names of the column tuples.
        csvToTuple.addHeaderIncluded(true);
        
        // Specify the type of data in each column.
        csvToTuple.addOutputTypesAsArray(
            new int[]{TupleTypes._STRING, TupleTypes._INT, TupleTypes._FLOAT});
        
        // Create a TupleToWebRowSetCharArrays to convert a tuple list to
        // XML Web Row Set format
        TupleToWebRowSetCharArrays tupleToWebRowSet = 
            new TupleToWebRowSetCharArrays();
        tupleToWebRowSet.connectDataInput(csvToTuple.getResultOutput());
        
        // Deliver the result to the requets status
        DeliverToRequestStatus deliverToRequestStatus = 
            new DeliverToRequestStatus();
        deliverToRequestStatus.connectInput(tupleToWebRowSet.getResultOutput());
        
        // Build the pipeline workflow
        PipelineWorkflow pipeline = new PipelineWorkflow();
        pipeline.add(csvToTuple);
        pipeline.add(tupleToWebRowSet);
        pipeline.add(deliverToRequestStatus);
        
        // Get hold of the DRER
        Server server = new ServerProxy();
        server.setDefaultBaseServicesURL(
            new URL("http://localhost:8080/wsrf/services/dai"));
        DataRequestExecutionResource drer = 
            server.getDataRequestExecutionResource(
                new ResourceID("DataRequestExecutionResource"));
        
        // Execute the workflow
        drer.execute(pipeline, RequestExecutionType.SYNCHRONOUS);

        // Print out the XML Web Row Set data
        while( tupleToWebRowSet.hasNextResult())
        {
            BufferedReader bufferedReader = 
                new BufferedReader(tupleToWebRowSet.nextResult());
            
            String line;
            while( (line = bufferedReader.readLine()) != null )
            {
                System.out.println(line);
            }
        }
    }
}

Running the program will produce the following output which is the tuple stream in XML Web Row Set format:

<webRowSet 
  xmlns="http://java.sun.com/xml/ns/jdbc" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
<properties>
<command></command>
<concurrency></concurrency>
<datasource></datasource>
<escape-processing>true</escape-processing>
<fetch-direction>1000</fetch-direction>
<fetch-size>0</fetch-size>
<isolation-level>0</isolation-level>
<key-columns></key-columns>
<map></map>
<max-field-size>0</max-field-size>
<max-rows>0</max-rows>
<query-timeout>0</query-timeout>
<read-only>true</read-only>
<rowset-type>1003</rowset-type>
<show-deleted>false</show-deleted>
<table-name></table-name>
<url></url>
<sync-provider>
<sync-provider-name/>
<sync-provider-vendor/>
<sync-provider-version/>
<sync-provider-grade/>
<data-source-lock/>
</sync-provider>
</properties>
<metadata>
<column-count>3</column-count>
<column-definition>
<column-index>1</column-index>
<auto-increment></auto-increment>
<case-sensitive></case-sensitive>
<currency></currency>
<nullable>2</nullable>
<signed></signed>
<searchable></searchable>
<column-display-size>0</column-display-size>
<column-label>name</column-label>
<column-name>name</column-name>
<schema-name></schema-name>
<column-precision>0</column-precision>
<column-scale>0</column-scale>
<table-name></table-name>
<catalog-name></catalog-name>
<column-type>12</column-type>
<column-type-name>VARCHAR</column-type-name>
</column-definition>
<column-definition>
<column-index>2</column-index>
<auto-increment></auto-increment>
<case-sensitive></case-sensitive>
<currency></currency>
<nullable>2</nullable>
<signed></signed>
<searchable></searchable>
<column-display-size>0</column-display-size>
<column-label>age</column-label>
<column-name>age</column-name>
<schema-name></schema-name>
<column-precision>0</column-precision>
<column-scale>0</column-scale>
<table-name></table-name>
<catalog-name></catalog-name>
<column-type>4</column-type>
<column-type-name>INTEGER</column-type-name>
</column-definition>
<column-definition>
<column-index>3</column-index>
<auto-increment></auto-increment>
<case-sensitive></case-sensitive>
<currency></currency>
<nullable>2</nullable>
<signed></signed>
<searchable></searchable>
<column-display-size>0</column-display-size>
<column-label>height</column-label>
<column-name>height</column-name>
<schema-name></schema-name>
<column-precision>0</column-precision>
<column-scale>0</column-scale>
<table-name></table-name>
<catalog-name></catalog-name>
<column-type>8</column-type>
<column-type-name>DOUBLE</column-type-name>
</column-definition>
</metadata>
<data><currentRow>
<columnValue>ally</columnValue>
<columnValue>37</columnValue>
<columnValue>1.5</columnValue>
</currentRow><currentRow>
<columnValue>ross</columnValue>
<columnValue>2</columnValue>
<columnValue>0.7</columnValue>
</currentRow><currentRow>
<columnValue>bob</columnValue>
<columnValue>20</columnValue>
<columnValue>1.4</columnValue>
</currentRow></data>
</webRowSet>

The highlighted sections show the column name and column type metadata and also the data values. This shows that the tuples have correctly been extracted from the CSV data and tuple metadata has been constructed from the header row and the column types the user specified.

H.7.2. TupleSimpleMerge

Summary:

  • This activity merges N streams of tuples into one stream, where each output tuple is made up of the combined columns of the input tuples.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.TupleSimpleMerge.
  • Server class: uk.org.ogsadai.activity.transform.TupleSimpleMergeActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.TupleSimpleMerge.

Inputs:

  • data: types [uk.org.ogsadai.tuple.Tuple]. Conditions: there must be two or more inputs compsed of Tuple Lists.

Outputs:

  • result: types [uk.org.ogsadai.tuple.Tuple]. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • Each input data, for inputs upto N where N is the number of inputs, will have a single tuple read from them. These tuples will be output as a single tuple on result.

Activity contracts:

  • None.

Behaviour:

  • Basic Behaviour: The activity will accept as input, N lists of tuples. The activity will in turn read one tuple from each list. The N tuples which have been read will be combined into one output tuple. The output tuple will be composed of the columns which were present in the N input tuples. The output from the activity will be a list of these combined tuples.
  • The activity will throw an UNMATCHED_ACTIVITY_INPUTS exception if one input terminates before other continuing inputs. Partial output will be written upto the point where the input terminated.

H.7.3. TupleSplit

Summary:

  • This activity takes an input stream of tuples and forms an output stream per column.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.TupleSplit.
  • Server class: uk.org.ogsadai.activity.transform.TupleSplitActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.TupleSplit.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • data: types [uk.org.ogsadai.tuple.Tuple]. Conditions: none.

Outputs:

  • result: types [java.lang.Object]. Constraints: there must be one or more of these objects.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A.

Activity contracts:

  • None.

Behaviour:

  • Basic behaviour of the TupleSplit Activity is to take Tuple(s) and write each column of the tuple to a seperate output, so the output result i contains the contents of the ith column of the input. For example if a Tuple (name, age, address) was the input, the output would be (name) (age) (address) where each value is written to its respective result.
  • If the number of columns of the tuple is greater than the number of outputs then the additional columns of the tuple will not be written to any output. The activity will write out the first x columns to outputs where x is the number of outputs.
  • If the number of outputs is greater than the column count of the tuple, i.e. 4 output for a 2 column tuple, then an TUPLE_OUTPUTS_SIZE_MISMATCH_EXCEPTION error will occur.
  • An assumption here is that the outputs would be as many as the columns in the data input and that they will be ordered accordingly.

H.7.4. TupleProjection

Summary:

  • This activity projects on certain columns of a Tuple.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.TupleProjection.
  • Server class: uk.org.ogsadai.activity.transform.TupleProjectionActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.TupleProjection.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • columnIds: types [uk.org.ogsadai.tuple.Tuple]. Conditions: none.
  • data: types [uk.org.ogsadai.tuple.Tuple]. Conditions: none.

Outputs:

  • result: types [uk.org.ogsadai.tuple.Tuple]. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A.

Activity contracts:

  • None.

Behaviour:

  • Accepts a list of columns and projects them for each Tuple given as input producing an appropriate Tuple in the output. Input columnIds is of the form >columnId<.
  • This activity will read two lists and produce one list; thus, it is Repeating. From inside the lists it will read the whole list of input columnIds and then process the data from the other list one by one using that projection specification, thus it is Dynamic.

H.7.5. TupleToCSV

Summary:

  • Activity converts lists of tuples to a CSV formatted output of type [char[]].
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.TupleToCSV.
  • Server class: uk.org.ogsadai.activity.transform.TupleToCSVActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.TupleToCSV.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • data: type: uk.org.ogsadai.tuple.Tuple
  • delimiter: type: java.lang.String
  • lineBreak: type: java.lang.String
  • nullDataString: type: java.lang.String
  • includeHeader: type: java.lang.Boolean
  • escapeFields: type: java.lang.Boolean

Outputs:

  • result: type: [char[]]
Configuration parameters:

Inputs other than input data are configuration for the CSV output from the activity.

  • delimiter: default: ","
  • lineBreak: default: LineFeed
  • nullDataString: default: Null
  • includeHeader: default: false
  • escapeFields: default: false

Activity input/output ordering:

Input ordering to TupleToCSV is important and is expected in the following order.

  • delimiter
  • lineBreak
  • nullDataString
  • includeHeader
  • escapeFields
  • data

Activity contracts:

  • None

Behaviour:

  • Normal behaviour of the TupleToCSV activity is for the activity to receive as input a list of tuples from another activity. Then this activity will transform the tuples into a CSV output using the CSV configuration as set by the input parameters or defaults and the tuple metadata.
  • The output from the activity will be of the form [char[]] and be formatted according to the CSV options used. The default settings will produce an output similar to: [ 23,TestAName,44 Calder Street,03403829 ] where [ ... ] denote the list markers and the input was a single tuple.
  • The output will start with a ListBegin and end with a ListEnd. Each line of output between these markers will be the output from a tuple of input.
  • Altering the configuration will change the output, for example setting the escapeFields and includeHeader to true and the delimiter to @ produces: [ "id"@"name"@"address"@"phone" 23@"TestAName"@"44 Calder Street"@"03403829" ]
  • Should an input fail unexpected, for example the data input, an error will occur and the activity will stop operation. The returned error will be: uk.org.ogsadai.PIPE_CLOSED_DUE_TO_PRODUCER_ERROR

H.7.6. TupleToWebRowSetCharArrays

Summary:

  • Activity converts lists of tuples to a WebRowSet XML formatted output of type [char[]].
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.TupleToWebRowSetCharArrays.
  • Server class: uk.org.ogsadai.activity.transform.TupleToWebRowSetCharArraysActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.TupleToWebRowSetCharArrays.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • data: type: uk.org.ogsadai.tuple.Tuple

Outputs:

  • result: type: [char[]]

Configuration parameters:

  • None.

Activity input/output ordering:

  • N/A

Activity contracts:

  • None

Behaviour:

  • In normal operation, the activity receives as input a list of tuples and produces a WebRowSet format output in the form of [char[]]. The tuple metadata is used to create the metadata for describing the results in the WebRowSet. The tuples are then output as WebRowSet XML to attached to this metadata. An example output is shown.
  • Example WebRowSet Output:
    <webRowSet xmlns="http://java.sun.com/xml/ns/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
    <properties>
    <command></command>
    <concurrency></concurrency>
    <datasource></datasource>
    <escape-processing>true</escape-processing>
    <fetch-direction>1000</fetch-direction>
    <fetch-size>0</fetch-size>
    <isolation-level>0</isolation-level>
    <key-columns></key-columns>
    <map></map>
    <max-field-size>0</max-field-size>
    <max-rows>0</max-rows>
    <query-timeout>0</query-timeout>
    <read-only>true</read-only>
    <rowset-type>1003</rowset-type>
    <show-deleted>false</show-deleted>
    <table-name></table-name>
    <url></url>
    <sync-provider>
    <sync-provider-name/>
    <sync-provider-vendor/>
    <sync-provider-version/>
    <sync-provider-grade/>
    <data-source-lock/>
    </sync-provider>
    </properties>
    <metadata>
    <column-count>4</column-count>
    <column-definition>
    <column-index>1</column-index>
    <auto-increment></auto-increment>
    <case-sensitive></case-sensitive>
    <currency></currency>
    <nullable>1</nullable>
    <signed></signed>
    <searchable></searchable>
    <column-display-size>11</column-display-size>
    <column-label>id</column-label>
    <column-name>id</column-name>
    <schema-name></schema-name>
    <column-precision>11</column-precision>
    <column-scale>0</column-scale>
    <table-name></table-name>
    <catalog-name></catalog-name>
    <column-type>4</column-type>
    <column-type-name>INTEGER</column-type-name>
    </column-definition>
    <column-definition>
    <column-index>2</column-index>
    <auto-increment></auto-increment>
    <case-sensitive></case-sensitive>
    <currency></currency>
    <nullable>1</nullable>
    <signed></signed>
    <searchable></searchable>
    <column-display-size>64</column-display-size>
    <column-label>name</column-label>
    <column-name>name</column-name>
    <schema-name></schema-name>
    <column-precision>64</column-precision>
    <column-scale>0</column-scale>
    <table-name></table-name>
    <catalog-name></catalog-name>
    <column-type>12</column-type>
    <column-type-name>VARCHAR</column-type-name>
    </column-definition>
    <column-definition>
    <column-index>3</column-index>
    <auto-increment></auto-increment>
    <case-sensitive></case-sensitive>
    <currency></currency>
    <nullable>1</nullable>
    <signed></signed>
    <searchable></searchable>
    <column-display-size>128</column-display-size>
    <column-label>address</column-label>
    <column-name>address</column-name>
    <schema-name></schema-name>
    <column-precision>128</column-precision>
    <column-scale>0</column-scale>
    <table-name></table-name>
    <catalog-name></catalog-name>
    <column-type>12</column-type>
    <column-type-name>VARCHAR</column-type-name>
    </column-definition>
    <column-definition>
    <column-index>4</column-index>
    <auto-increment></auto-increment>
    <case-sensitive></case-sensitive>
    <currency></currency>
    <nullable>1</nullable>
    <signed></signed>
    <searchable></searchable>
    <column-display-size>20</column-display-size>
    <column-label>phone</column-label>
    <column-name>phone</column-name>
    <schema-name></schema-name>
    <column-precision>20</column-precision>
    <column-scale>0</column-scale>
    <table-name></table-name>
    <catalog-name></catalog-name>
    <column-type>12</column-type>
    <column-type-name>VARCHAR</column-type-name>
    </column-definition>
    </metadata>
    <data>
    <currentRow>
    <columnValue>23</columnValue>
    <columnValue>TestAName</columnValue>
    <columnValue>44 Calder Street</columnValue>
    <columnValue>03403829</columnValue>
    </currentRow>
    </data>
    </webRowSet>
    
  • In the case of an error occuring on the input, such as a premature pipe closure or failure, the activity will process upto that point and output everything upto the error. The error will then be propogated to the next activity and eventually returned in an error message to the client.
  • Performance issues can arise in server-client communications due to the verbosity of this format. This is evident if results are returned via a request status. When using a WebRowSet format to return results, it would better to use an alternative delivery method such as a data source or via FTP for performance reasons. Refer to Chapter 22, Best practice for more information about data formats, delivery options and performance.

H.7.7. WebRowSetCharacterDataToTuple

Summary:

  • Activity that converts data expressed as CharacterData, which represents parts of a WebRowSet document to tuples.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.WebRowSetCharacterDataToTuple.
  • Server class: uk.org.ogsadai.activity.transform.WebRowSetCharacterDataToTupleActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.WebRowSetCharacterDataToTuple.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • data: type: uk.org.ogsadai.tuple.Clob or list of char[]

Outputs:

  • result: type: list of tuples

Configuration parameters:

  • None.

Activity input/output ordering:

  • None.

Activity contracts:

  • None

Behaviour:

  • In normal operation, the activity receives as input a uk.org.ogsadai.tuple.Clob object or a list of char[] which represent a WebRowSet format and produces a list of tuples. The metadata of the WebRowSet is used to create the metadata for describing the tuples of the list.
  • In the case of an error occuring on the input, such as a premature pipe closure or failure, the activity will process upto that point and output everything upto the error. The error will then be propogated to the next activity and eventually returned in an error message to the client.
  • Various errors can occur while parsing the WebRowSet document. These errors in result in corresposnding exceptions such as org.xml.sax.SAXParseException, org.xml.sax.SAXWrappedException, org.xml.sax.SAXException to be thrown.

H.7.8. XSLTransform

Summary:

  • This activity transforms an XML document into another text document by applying an XSL transformation.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.XSLTransform.
  • Server class: uk.org.ogsadai.activity.transform.XSLTransform.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.transform.XSLTransform.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • xslt: type [ char[] ]. Conditions: Each list of character arrays must form a valid XSLT document.
  • xml: type [ char[] ]. Conditions: Each list of character arrays must form a well-formed XML document.

Outputs:

  • result: type [ char[] ]. Constraints: none.
Configuration parameters:
  • None.

Activity input/output ordering:

  • The XSLT document is read in full at the beginning of each iteration and a validation check is performed. Then the XML document is read and the transformation performed.
  • A user exception is raised if any problems occurred during the XSLT processing, for example if the input XSLT document is not valid or if the input document to transform is not an XML document.
  • A deadlock could occur if the XML data input is provided before the XSLT input.

Activity contracts:

  • None.

Behaviour:

  • In each iteration, an input XML document is read from the xml input and transformed using the XSL transformation instructions from the xslt.
  • Note that XSL transformations are not processed in a streaming fashion. The complete input and output documents are held in memory and their sizes are therefore constrained by the available memory on the server.

H.8. Utility activities

H.8.1. Echo

Summary:

  • Activity that echos its input to its output and then optionally reports an error at the end of the stream, or instead of the nth value in the stream.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.Echo.
  • Server class: uk.org.ogsadai.activity.util.EchoActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.util.Echo.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • input: type: Java.lang.Object
  • errorAt: type: java.lang.Integer Conditions: Optional input indicating if an error should be thrown at the end of the stream,or instead of the nth value in the stream. A value of -1 indicates that an error will be thrown at the end of the stream, a value of -2 indicates that no error will be thrown at the end of the stream and a value greater than 0 indicates at which value of the stream the error should be thrown.

Outputs:

  • output: type: java.lang.Object
Configuration parameters:
  • None

Activity input/output ordering:

  • None

Activity contracts:

  • None

Behaviour:

  • An uk.org.ogsadai.uk.org.ogsadai.activity.block.ActivityOutOfBoundsException will be thrown if the corresponding input indicates so.
  • In the case of an error occuring on the input, such as a premature pipe closure or failure, the activity will process upto that point and output everything upto the error. The error will then be propogated to the next activity and eventually returned in an error message to the client.
  • This activity is useful for testing purposes while being connected between other activities.

H.8.2. HashCode

Summary:

  • Activity that outputs the hash code of its input.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.HashCode.
  • Server class: uk.org.ogsadai.activity.util.HashCodeActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.util.HashCode.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • input: type: java.lang.Object

Outputs:

  • output: type: java.lang.Long
Configuration parameters:
  • None

Activity input/output ordering:

  • None

Activity contracts:

  • None

Behaviour:

  • Normally this activity takes any object as input and returns the hash code of this object to the output.
  • In the case of an error occuring on the input, such as a premature pipe closure or failure, the activity will process upto that point and output everything upto the error. The error will then be propogated to the next activity and eventually returned in an error message to the client.
  • This activity is useful for testing purposes while being connected between other activities.

H.8.3. ReadString

Summary:

  • Activity that writes to the output the string representation of the string resource that it targets at.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.ReadString.
  • Server class: uk.org.ogsadai.activity.util.ReadStringActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.util.ReadString.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.string.StringResourceAccessor

Inputs:

  • None

Outputs:

  • output: type: java.lang.String
Configuration parameters:
  • None

Activity input/output ordering:

  • None

Activity contracts:

  • None

Behaviour:

  • Normally the activity writes to the output the string that is held by the string resource that the activity targets at.
  • In the case of an error occuring on the input, such as a premature pipe closure or failure, the activity will process upto that point and output everything upto the error. The error will then be propogated to the next activity and eventually returned in an error message to the client.
  • This activity is primarily useful for testing purposes.

H.8.4. Sleep

Summary:

  • Activity that sleeps for the specified duration (in milliseconds) provided by the corresponding input.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.Sleep.
  • Server class: uk.org.ogsadai.activity.util.SleepActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.util.Sleep.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • duration: type: Java.lang.Number

Outputs:

  • None.
Configuration parameters:
  • None

Activity input/output ordering:

  • None

Activity contracts:

  • None

Behaviour:

  • Normally the activity sleeps for a duration specified from its input. This activity is primarily useful for testing purposes.

H.8.5. Timestamp

Summary:

  • Activity that outputs the number of milliseconds since January 1 1970 , 00:00:00 GMT.
  • Activity Name as exposed by OGSA-DAI: uk.org.ogsadai.Timestamp.
  • Server class: uk.org.ogsadai.activity.util.TimestampActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.util.Timestamp.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • None.

Inputs:

  • None.

Outputs:

  • output: type: java.lang.Long
Configuration parameters:
  • None

Activity input/output ordering:

  • None

Activity contracts:

  • None

Behaviour:

  • Normally the activity write to the output the number of milliseconds since January 1 1970 , 00:00:00 GMT. This activity is primarily useful for testing purposes.
  • In the case of an error occuring on the input, such as a premature pipe closure or failure, the activity will process upto that point and output everything upto the error. The error will then be propogated to the next activity and eventually returned in an error message to the client.

H.9. XMLDB activities

H.9.1. XMLListCollections

Summary:

  • Activity for listing the collections available in a given parent collection of an XMLDB data resource.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.XMLListCollections.
  • Server class: uk.org.ogsadai.activity.xmldb.XMLListCollectionsActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.xmldb.XMLListCollections.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.xmldb.XMLDBCollectionProvider

Inputs:

  • parentCollection: type: java.lang.String

Outputs:

  • data: type: [java.lang.String]
Configuration parameters:
  • None.

Activity input/output ordering:

  • N/A

Activity contracts:

  • None

Behaviour:

  • Normal operation should occur when a valid parent collection name is input to the activity. The activity will then access the XMLDB data resource and for the given input, return a list of the available collections in the form of [String].
  • The activity can return ActivityUserException where a invalid collection name is used as input.

H.9.2. XMLListResources

Summary:

  • Activity for listing the resources available in a given XMLDB collection of an XMLDB data resource.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.XMLListResources.
  • Server class: uk.org.ogsadai.activity.xmldb.XMLListResourcesActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.xmldb.XMLListResources.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.xmldb.XMLDBCollectionProvider

Inputs:

  • parentCollection: type: java.lang.String

Outputs:

  • data: type: [java.lang.String]
Configuration parameters:
  • None.

Activity input/output ordering:

  • NA

Activity contracts:

  • None

Behaviour:

  • Normal operation should occur when a valid parent collection name is input to the activity. The activity will then access the XMLDB data resource and for the given input, return a list of the available resources in that collection in the form of a list of strings.
  • The activity can return ActivityUserException where a invalid collection name is used as input.

H.9.3. XPathQuery

Summary:

  • Activity for executing XPath queries on a XMLDB data resource.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.XPathQuery.
  • Server class: uk.org.ogsadai.activity.xmldb.XPathQueryActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.xmldb.XPathQuery.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.xmldb.XMLDBCollectionProvider

Inputs:

  • collection: type: java.lang.String
  • resourceID: type: java.lang.String
  • namespace: list of java.lang.Strings.
  • expression: type: java.lang.String

Outputs:

  • data: type: [char[]]
Configuration parameters:
  • None.

Activity input/output ordering:

  • Input Ordering

    • collection
    • resourceID
    • namespace
    • expression

Activity contracts:

  • None

Behaviour:

  • Normal operation of this activity allows an XPath expression to be enacted upon a specified XMLDB data resource using the default or specfied collection name and any namespaces provided. Note: a namespace does not necessarily have to be present. The output from this is a series of character arrays which are a ResourceSet written to blocks for the activity output.
  • Partial results are possible where an error occurs during processing but malformed XML may be present.
  • The activity can return ActivityUserException where a malformed query, invalid namespaces or collections are used as input.

H.9.4. XQuery

Summary:

  • Activity for executing XQueries on a XMLDB data resource.
  • Activity name as exposed by OGSA-DAI: uk.org.ogsadai.XQuery.
  • Server class: uk.org.ogsadai.activity.xmldb.XQueryActivity.
  • Client toolkit class: uk.org.ogsadai.client.toolkit.activities.xmldb.XQuery.
  • Applicable resources: this activity can be applied to resources that implement the following interfaces:
    • uk.org.ogsadai.resource.dataresource.xmldb.XMLDBCollectionProvider

  • collection: type: java.lang.String
  • resourceID: type: java.lang.String
  • namespace: type: list of java.lang.Strings.
  • expression: type: java.lang.String

Outputs:

  • data: type: [char[]]
Configuration parameters:
  • None.

Activity input/output ordering:

  • Input Ordering

    • collection
    • resourceID
    • namespace
    • expression

Activity contracts:

  • None

Behaviour:

  • Normal operation of this activity allows an expression to be enacted upon a specified XMLDB data resource using the default or specfied collection name and any namespaces provided. Note: a namespace does not necessarily have to be present. The output from this is a series of character arrays which are a ResourceSet written to blocks for the activity output.
  • Partial results are possible where an error occurs during processing but malformed XML may be present.
  • The activity can return ActivityUserException where a malformed query, invalid resource, invalid namespaces or collections are used as input.

H.10. Status of activities in OGSA-DAI 3.0

This list outlines the activities supported in OGSA-DAI 3.0. Prior to release activities were subject to review. This review covered:

  • Both server and client toolkit activity conformance to the activity specification of Karasavvas, K. Atkinson, M.P. and Hume, A.C. OGSA-DAI - Redesigned and New Activities. http://www.ogsadai.org.uk/documentation/ogsadai3.0/RedesignedAndNewActivitiesV1.9.pdf
    • Conformance to input names.
    • Conformance to input types and allowed values.
    • Conformance to output types.
  • Iteration model used.
  • Validation of activity inputs.
  • Error handling and robustness.
  • Test coverage of both the activity and its client toolkit counterpart.
  • User documentation of the activity inputs, outputs, types, input ordering, behaviour, class names, activity extension interfaces implemented and compliant resources in Appendix H, Activities in OGSA-DAI 3.0.

[Note]Note

This review was not completed in time for the release. It is intended that at a suitable point after completion of this review updated user documentation and any updated activities (as a consequence of identified bugs, improvements to error handling, robustness or behaviour or to make conformant with the specification) will be released.

NameServer-Side Class

Sub-packages of uk.org.ogsadai.activity.

Client-Side Class

Sub-packages of uk.org.ogsadai.client.toolkit.activities.

Reviewed?
Block Activitiesblock.block. 
ByteArraysResizeByteArraysResizeActivityByteArraysResizeYes
CharArraysResizeCharArraysResizeActivityCharArraysResizeYes
ControlledRepeatControlledRepeatActivityControlledRepeatYes
ListConcatenateListConcatenateActivityListConcatenateYes
ListControlledRepeatListControlledRepeatActivityListControlledRepeatYes
ListMultiplyListMultiplyActivityListMultiply-
SplitSplitActivitySplit-
TeeTeeActivityTeeYes
ListRemoveListRemoveActivityListRemoveYes
Delivery Activitiesdelivery.delivery. 
DeliverToDataSinkDeliverToDataSinkActivityDeliverToDataSinkYes
DeliverToFTPDeliverToFTPActivityDeliverToFTPYes
DeliverToGFTPDeliverToGFTPActivityDeliverToGFTPYes
DeliverToHTTPDeliverToHTTPActivity--
DeliverToRequestStatusDeliverToRequestStatusActivityDeliverToRequestStatusYes
DeliverToSessionDeliverToSessionActivityDeliverToSession-
DeliverToSMTPDeliverToSMTPActivityDeliverToSMTPYes
ObtainFromFTPObtainFromFTPActivityObtainFromFTPYes
ObtainFromGFTPObtainFromGFTPActivityObtainFromGFTPYes
ObtainFromHTTPObtainFromHTTPActivityObtainFromHTTP-
ObtainFromSessionObtainFromSessionActivityObtainFromSession-
ObtainFromDataSourceObtainFromDataSourceActivityObtainFromDataSourceYes
ReadFromDataSinkReadFromDataSinkActivityReadFromDataSinkYes
WriteToDataSourceWriteToDataSourceActivityWriteToDataSourceYes
File Activitiesfile.file. 
ReadFromFileReadFromFileActivityReadFromFileYes
ListDirectoryListDirectoryActivityListDirectoryYes
Management Activitiesmanagement.management. 
CreateDataSinkCreateDataSinkActivityCreateDataSinkYes
CreateDataSourceCreateDataSourceActivityCreateDataSourceYes
CreateResourceGroupCreateResourceGroupActivityCreateResourceGroupYes
Relational Activitiessql.sql. 
ExtractTableSchemaExtractTableSchemaActivityExtractTableSchema-
GetAvailableTableGetAvailableTableActivityGetAvailableTableYes
SQLBagSQLBagActivitySQLBagYes
SQLBulkLoadTupleSQLBulkLoadTupleActivitySQLBulkLoadTupleYes
SQLParameterisedQuerySQLParameterisedQueryActivitySQLParameterisedQueryYes
SQLParameterisedUpdateSQLParameterisedUpdateActivitySQLParameterisedUpdateYes
SQLQuerySQLQueryActivitySQLQueryYes
SQLResilientSQLResilientActivitySQLResilientYes
SQLUpdateSQLUpdateActivitySQLUpdateYes
Transformation Activitiestransform.transform. 
CSVToTupleCSVToTupleActivityCSVToTupleYes
NumberToStringActivityNumberToStringActivity--
StringConcatenateActivityStringConcatenateActivity--
StringTokenizeActivityStringTokenizeActivity--
TupleProjectionTupleProjectionActivityTupleProjectionYes
TupleSimpleMergeTupleSimpleMergeActivityTupleSimpleMergeYes
TupleSplitTupleSplitActivityTupleSplitYes
TupleToCSVTupleToCSVActivityTupleToCSVYes
TableMetadataToXMLCharArraysTableMetadataToXMLCharArraysActivityTableMetadataToXMLCharArrays-
TupleToWebRowSetCharArraysTupleToWebRowSetCharArraysActivityTupleToWebRowSetCharArraysYes
WebRowSetCharacterDataToTupleWebRowSetCharacterDataToTupleActivityWebRowSetCharacterDataToTupleYes
Utility Activitiesutil.util. 
ActivityUserErrorProducerActivityUserErrorProducerActivityActivityUserErrorProducer-
CloneableObjectProducerCloneableObjectProducerActivityCloneableObjectProducer-
CounterCounterActivityCounter-
DQPPatternDQPPatternActivityDQPPattern-
EchoEchoActivityEchoYes
HashCodeHashCodeActivityHashCodeYes
ReadStringReadStringActivityReadStringYes
SleepSleepActivitySleepYes
TimestampTimestampActivityTimestampYes
XSLTransformXSLTransformActivityXSLTransformYes
XMLDB Activitiesxmldb.xmldb. 
XMLListCollectionsXMLListCollectionsActivityXMLListCollectionsYes
XMLListResourcesXMLListResourcesActivityXMLListResourcesYes
XPathQueryXPathQueryActivityXPathQueryYes
XQueryXQueryActivityXQueryYes

Table H.1. Status of activities in OGSA-DAI 3.0