When you generate a task interface object, a task file is always generated regardless of your other selections. Task files contain metadata about one or more task definitions created in Task Builder. They are used during run-time to help parse the client-supplied instance XML for an ICA call. The parsing and processing of the input XML with the help of the metadata in the task file is what allows Services Builder to create a COMMAREA image of data to send to CICS in order to run one of the existing programs on the host.
Description |
Example |
Instantiate the connector class for your Synapta Services Builder. The examples create the instance "myconnector." |
CICSConnectorAccess myconnector = new
CICSConnectorAccess(); |
Initialize your connector by opening your task file. The argument is the path to the file. |
myconnector.open (path\to\my_connector.xml); |
Get the metadata for your task. If the task id is -1, then all tasks are returned. |
String xmlString = myconnector.getMetaData(-1); |
Optionally, set a timeout for the task execution. The default is "-1", indicating no timeout is set. |
myconnector.setTimeOut("-1"); |
Optionally, set the maximum return data size. The default is -1, indicating all data is returned. |
myconnector.setMaxSize(-1); |
Execute the task. The argument is the task id and the task inputs as xml. |
myconnector.execute(task_id, inputXML); |
Retrieve the data. |
String outputXML = myconnector.getData
(task_id); |
Close the runtime service. |
myconnector.close(); |