In addition to runtime parameters, exits support a metadata interface to permit their setup using the console.
The Wizard tools provided to construct exit frameworks automatically generate these metadata methods to describe the component. Usually, there is no reason to modify this code. The descriptions of the most common metadata methods are provided in the following list.
Returns a short string describing the purpose of the exit. For example, the description of XDCopyAgent is: Copies document from in to out. The description appears as help text when the exit is selected during configuration.
The label is a short name that appears in the exit selection list. For example, copy documents.
Exits are sorted in category groups to assist process flow developers in finding the correct exit. Any exit can be in one or more categories. Exits that do not implement this method are placed in the misc category.
An exit is placed into multiple categories by returning a comma-delimited list, for example, queue,emit for the MQ emit agent. During the compile phase, a set of categories are available to the programmer, each starting with the prefix GROUP_. Your exit should always use an available group as opposed to creating your own, although there is no real constraint on the string you return. For example, in Java:
return GROUP_QUEUE+GROUP_EMIT;
The execute() method returns the list of edges to be followed in a process flow. Implement this method to return the list of possible edges that the execute() method can return. iWay Designer uses this information to manage the edges that can be described in the flow.
Return null if you cannot predict the set of values returned from execute().
The default method (if you do not implement your own) returns an array signifying that success is the only possible result. By default, error is returned when your execute() method throws an exception, and is always permitted by the Designer program. If execute() returns an unpredicted result (one for which there is no edge defined), the process flow attempts to go down the default edge. If no such edge is defined, error is used. If no error is defined on the node, the flow throws an exception.
String[] getOPEdges() { String[] rts = {"asset","liability"}; return rts; }
A set of mnemonics are defined for common edge names. You should always use a common name when returning an edge name if possible. The mnemonics begin with EX_. Some common examples are shown in the following table. The Javadoc lists the available common mnemonics.
Mnemonic |
Description |
---|---|
EX_CANCELLED |
The exit was cancelled by an external request. |
EX_DUPLICATE |
Attempting to perform an operation detected a duplicate. This may not be a failure. |
EX_FAIL_CONNECT |
The exit cannot connect to an external resource. |
EX_FAIL_DUPLICATE |
Attempting to perform an operation detected a duplicate. This is a failure. |
EX_FAIL_NOTFOUND |
A resource was not found. |
EX_FAIL_OPERATION |
The exit could not complete due to some non-specific cause. |
EX_FAIL_PARSE |
The iFL cannot be parsed - syntax error. |
EX_FAIL_PARTNER |
The exit received a failure from a [connection] partner. |
EX_FAIL_SECURITY |
The exit could not proceed due to a security violation. |
EX_FAIL_UNREACHABLE |
The exit attempted to reach an external host. The host was identifiable but not reachable. It is usually a network problem. |
EX_NOTFOUND |
A resource was not found, but this is not a failure. An example might be to handle a situation in which a key is not in a database. |
EX_SUCCESS |
Some resource was not found, but this is not a failure. An example might be to handle a situation in which a key is not in a data base. |
The server provides for two methods of signaling a desire to cancel:
The simplest method to test this is to use the following Java call:
Thread.currentThread()isInterrupted()
You can then escape the current adapter if it is true. Do not reset the interrupted flag, as other threads may need to interrogate it. Proper use of this facility is discussed in relevant Java documentation.
If the exit implements the cancel() method, it returns true, else returns false. This method will be called immediately prior to the server calling cancel(). There may be phases of your exit that can be safely cancelled, and others that cannot. You can control whether the cancel() will be called by returning the appropriate result. The default is false.
The thread isInterrupted() call is not masked, but the exit can elect to test it at appropriate times.