Integration Object chaining

Integration Object chaining can break up a complex application into multiple tasks, with each task represented by an Integration Object. Chaining enables you to run several Integration Objects in sequence, with each Integration Object depending on the one before it for its input. Refer to Using Integration Objects for an introduction to Integration Object chaining. Integration Object chaining is quite different from macro chaining in that each Integration Object in a chain is run to completion before the next Integration Object in the chain takes control. Macro chaining, using the PlayMacro action, terminates the current macro (the one in which the PlayMacro action occurs) and begins to process the specified macro screen of the target macro. There is no return to the calling macro. See Macro actions for more information on macro chaining.

Integration Object chaining is handled by the following:
  • &sprod;applications using Integration Objects or the corresponding EJB Access Beans
  • Custom JSPs or servlets that use Integration Objects or the corresponding EJB Access Beans in a Web container
In these cases, the doHPTransaction execution method is used.
Properties that enable chaining must be retrieved and set for the following:
  • EJB Access Beans running outside of a Web container
  • Custom EJBs that use Integration Objects
In these cases, the processRequest execution method is used.

See Integration Object methods for a description of the doHPTransaction and processRequest methods.

ZIETrans provides methods that enable you to extract the key that represents the connection for the Integration Object chain from the first Integration Object in a chain and to set the property for subsequent Integration Objects in the chain. Properties that enable chaining for Web Services must also be retrieved and set.

To build an Integration Object chain using the processRequest method, do the following:
  1. Create an instance of the first Integration Object in the chain by calling its constructor.
  2. Invoke the methods for the Integration Object instance. You might want to invoke methods to set properties of input variables. The naming convention for setter methods is as follows:
    IOChain1.setXyz(String)
    where Xyz is the name of your input variable.
  3. Invoke the Integration Object to perform its task (running a macro, for example), using the method:
    IOChain1.processRequest()
  4. Check for errors by invoking:
    IOChain1.getHPubErrorOccurred()
  5. Extract and save the key that represents the connection for the Integration Object chain:
    String myLinkkey = IOChain1.getHPubLinkKey();
  6. Create an instance of the next Integration Object in the chain by calling its constructor.
  7. Set the key for this chained connection:
    IOChain2.setHPubLinkKey(myLinkkey);
  8. Invoke the methods for this Integration Object instance. You might want to invoke methods to set properties of input variables. The naming convention for setter methods is as follows:
    IOChain2.setXyz(String)
    where Xyz is the name of your input variable.
  9. Invoke this Integration Object to perform its task, using the method:
    IOChain2.processRequest()
  10. Check for errors by invoking:
    IOChain2.getHPubErrorOccurred()

Repeat steps 6 through 10 for any and all subsequent Integration Objects in the chain.

ZIETrans‐chained Web services

&prodname‐chained Web services require special consideration when used with Integration Objects. If you use chained Integration Objects within a &prodname Web service, you create a stateful Web service. &prodnae; runtime does not store data between invocations of chained Integration Objects in the same Web service. However, &prodnae; runtime does require that the next in chain Web service invocation be routed back to the same instance of the ZIETrans runtime, so the next&hyphe;in&hyphe;chain Integration Object uses the same Telnet connection.

If you are deploying the stateful ZIETrans Web service to a cluster, you can ensure that this occurs in one of the following ways:
  1. Create ZIETrans Web services from EJB Access Beans. The ZIETrans EJB is a stateful session EJB, so the EJB client always interacts with the same ZIETrans EJB instance.
  2. Configure the scope of the Web service to be session (either in the development environment or after deployment), and use the SESSION_MAINTAIN_PROPERTY in the Web service client runtime to maintain the session across invocations, ensuring HTTP session affinity.