|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.fc.Function
com.ibm.di.fc.AssemblyLineFC
public class AssemblyLineFC
This is a function component that calls an AssemblyLine(AL) on a local or remote server. The call can be made in three different modes.
When the FC runs an AssemblyLine in background mode, you can also call the FC with specific string values to obtain various info about the target AL:
fc.perform("target"); // returns the object reference of the target al fc.perform("active"); // returns either ""active", "aborted" or "terminated" depending on the target al status fc.perform("error"); // returns the java.lang.Exception object when the status is "aborted" fc.perform("result"); // returns the current result Entry object fc.perform("stop"); // tries to terminate an active target al - may throw an error if call does not succeedWhen the FC is called in this mode with an Entry object, the Entry object can contain one or more of the above keywords in the command Attribute. The returned Entry object is then populated with the same values as described above. So, rather than calling perform() with all keywords, you can create an Entry with all keywords as attributes in the Entry object and get away with one call to perform(): var e = system.newEntry(); e.setAttribute("command", "target, status"); var result = fc.perform(e); task.logmsg("The status is: " + result.getString("status")); When the FC runs an AL in manual mode, each call with an Entry object causes one cycle to be executed in the target AL. The returned Entry object is the work entry result of the cycle. When the target AL has completed, a null entry is returned. If the cycle execution causes an error, that error is re-thrown by the FC (you should use a try/catch block in your script).
To provide a TaskCallBlock (TCB) you can use the fc.getTCB() and set parameters in the returned TCB object. This object will be used the next time an AssemblyLine is started by this FC. You should only set connector parameters in the returned TCB as this FC will potentially overwrite the runmode and initial work entry.
Another way to set TCB parameters are by using the output attribute map where you define variables with the specific prefix "$tcb.". When these attributes are found in the entry they will be moved to the TCB and removed from the entry. This will only work when the FC runs an assemblyline each time the FC is called (e.g. run and await completion).
Field Summary | |
---|---|
static String |
ASSEMBLYLINE
Parameter name. |
static String |
CONFIG
Parameter name. |
static String |
CUSTOM_SEC
Parameter name. |
static String |
CYCLE_MODE
Parameter name. |
static String |
OPERATION
Parameter name. |
static String |
OPERATION_INIT_PREFIX
Prefix for operation initialization. |
static String |
SERVER
Parameter name. |
static String |
SHARE_LOG
Parameter name. |
static String |
SIMULATE_MODE
Parameter name. |
static String |
TCB
Parameter name. |
static String |
USE_TCB_ATTRS
Parameter name. |
Fields inherited from class com.ibm.di.fc.Function |
---|
logger |
Constructor Summary | |
---|---|
AssemblyLineFC()
Default constructor. |
Method Summary | |
---|---|
Session |
connectServer(String server)
Establish a server connection. |
ConfigInstance |
getConfigInstance(String ci)
Retrieves the ConfigInstance object using the provided ID from the current session. |
Session |
getSession()
Retrieves session object. |
TaskCallBlock |
getTCB()
Returns the TaskCallBlock to use before starting an instance. |
String |
getVersion()
Version information. |
void |
initialize(Object obj)
Called once to initialize the function |
Object |
perform(Object obj)
Executes the AL in the specified mode. |
Object |
performOperation(Object work,
String operation)
This method invokes an operation in the target AssemblyLine. |
Object |
performOperation(Object work,
String operation,
Entry opentry)
Performs the specified operation. |
List<Entry> |
querySchema(Object source)
This method translates to whatever means a function component has to discover schema for a connection. |
void |
terminate()
This method frees any resources allocated. |
boolean |
updateSchema(FunctionConfig config)
This method modifies the schema in the provided configuration. |
boolean |
updateSchemaConnector(ConnectorConfig config)
This method modifies the schema in the provided configuration. |
Methods inherited from class com.ibm.di.fc.Function |
---|
debug, getConfiguration, getContext, getDebug, getLog, getParam, getRSInterface, getUI, initialize, logmsg, setConfiguration, setContext, setDebug, setLog, setParam, setRSInterface, verifyInitialized |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ASSEMBLYLINE
public static final String SERVER
public static final String CONFIG
public static final String CYCLE_MODE
public static final String SIMULATE_MODE
public static final String TCB
public static final String CUSTOM_SEC
public static final String USE_TCB_ATTRS
public static final String SHARE_LOG
public static final String OPERATION
public static final String OPERATION_INIT_PREFIX
Constructor Detail |
---|
public AssemblyLineFC()
Method Detail |
---|
public Object perform(Object obj) throws Exception
obj
- the initial work entry for the AssemblyLine being executed (an
object of type com.ibm.di.entry.Entry)
Exception
- An exception is thrown if this method fails.public Object performOperation(Object work, String operation) throws Exception
work
- The work entryoperation
- The operation to invoke
Exception
public Object performOperation(Object work, String operation, Entry opentry) throws Exception
work
- the work entry to useoperation
- The AL operation.opentry
- Entry
Exception
- :
if an error occurs.public TaskCallBlock getTCB() throws Exception
Exception
public void initialize(Object obj) throws Exception
initialize
in interface FunctionInterface
initialize
in class Function
obj
- this parameter is ignored
Exception
- An exception is thrown if this method fails.public Session connectServer(String server) throws Exception
server
- server address
Exception
- :
never.public ConfigInstance getConfigInstance(String ci) throws Exception
ci
- the ID of the ConfigInstance to look for.
Exception
- if unable to establish a connection to the remote server or
the provided ID is null or an empty string.public Session getSession()
public void terminate() throws Exception
terminate
in interface FunctionInterface
terminate
in class Function
Exception
- An exception is thrown if this method fails.public boolean updateSchema(FunctionConfig config) throws Exception
updateSchema
in interface FunctionInterface
updateSchema
in class Function
config
- FunctionConfig
Exception
- :
neverpublic boolean updateSchemaConnector(ConnectorConfig config) throws Exception
config
- The connector configuration
Exception
- An exception is thrown if this method fails.public List<Entry> querySchema(Object source) throws Exception
Each Entry in the Vector returned should contain the following attributes:
Name | Value |
---|---|
name | The name of the column/attribute/field .... |
syntax | The syntax or expected value type |
size | If specified this will give the user a hint as to how long the field may be |
querySchema
in interface FunctionInterface
querySchema
in class Function
source
- The object on which to discover schema. This may be an Entry
or a string value. Boolean value will tell which schema to
discover: true - InputMapSchema, false - OutputMapSchema. If
not specified the default will be true. Might be a
FunctionConfig object which will be set as the configuration
of this object. Could be an array of objects (i.e. Object[]).
Only the first object of a specific type will be considered,
the rest (if any) will be ignored.
Exception
Entry
,
Vector
public String getVersion()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |