When you generate a task interface object, a task file is always generated regardless of your other selections. Task files are XML interface objects that implement the IConnectorAccess interface. They are used either directly by your application, or internally by the Runtime Service when you develop applications that use another type of task interface object.
![]() |
The XML task interface object is accessed through the task file created when any task interface object is generated. |
Description | Example |
---|---|
Instantiate the connector class for your connector. The examples create the instance "myconnector." | ScreenConnectorAccessImpl myconnector = new ScreenConnectorAccessImpl(); CICSConnectorAccess myconnector = new CICSConnectorAccess(); IMSConnectorAccess myconnector = new IMSConnectorAccess(); |
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.
There are four optional task inputs available: JobName, ResourceName, InstanceName, and COControlMapping. |
myconnector.execute(task_id, inputXML); |
Retrieve the data. | String outputXML = myconnector.getData(task_id); |
Close the connector. This frees the host session. | myconnector.close(); |
Typically, sessions are allocated just prior to task execution and then freed up immediately after task completion. There may be situations when it is necessary to maintain an allocated session from one task interface object to another. This is called preserving context.
Context is the host connection or session that has been allocated to a task. Pools of host connections are created using MCS, and each task, when executed, is allocated a session/connection. When you "preserve context," the session will not be disconnected after executing the task, making it available for future executions.
Synapta Services Builder for Screens context options are set in the XML task file. The possible values are:
![]() |
XML interface objects cannot transfer or copy context as beans can. |
![]() |
|
![]() |
Using Tasks in Your Applications, Overview |
![]() |
Sample Task File |
![]() |
IConnectorAccess Sample Code |
![]() |