|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.entry.DocImpl
com.ibm.di.entry.Entry
com.ibm.di.server.TaskCallBlock
public class TaskCallBlock
The TaskCallBlock (TCB) is used by a caller to set a number of parameters for an AssemblyLine. The TCB can provide the user with a list of input/output parameters specified by an AssemblyLine and also all the connectors and their parameters the user can set. You can use this feature to discover dynamically what an AssemblyLine is expecting as its initial work entry and also what it will return in its result entry. The TCB consists of the following logical sections:
var tcb = system.newTCB(); tcb.setInitialWorkEntry(iwe); tcb.setConnectorParameter("input", "filePath", "d:/myinput.txt"); var al = main.startAL("MyAssemblyLine", tcb);The TCB is also called by the AssemblyLine for each work entry in the AL. This work entry can be accumulated by the TCB into an object called the accumulator. The accumulator can be one of the following:
var parser = system.getParser ( "ibmdi.XML" ); parser.setOutputStream ( new java.io.FileOutputStream ( "d:/accum.xml" ); parser.initParser(); tcb.setAccumulator ( parser ); var al = main.startAL ( "MyAssemblyLine", tcb ); al.join(); parser.closeParser();Of course, you could configure a connector instead of programming the parser manually as in:
var connector = system.getConnector ("MypreconfiguredOutputConnectorWithXMLParser"); tcb.setAccumulator ( connector ); ... connector.terminate();The TCB is typically initialized by the user and then used by the assemblyline. If the assemblyline has a call/return specification the TCB will remap input attributes (initial work entry) into what the AL expects internally and likewise for setting the result object. This is done so that the external call interface to an assemblyline can remain the same even though the internal work entry names change in the assemblyline itself. Once the TCB is passed to an assemblyline you should not expect anything more from the TCB. Use the assemblyline's getResult() and getStats() to retrieve the result object and statistics. The TCB result mapping is performed before the Epilog so you can still access the final result before the caller of the AL gets to it.
Field Summary | |
---|---|
static String |
ACCUMULATOR_OBJECT
|
static String |
AL_OPERATION
|
static String |
AL_OPERATION_INIT
|
static String |
AL_SETTINGS
|
static String |
CONNECTOR_PARAMETERS
|
static String |
INITIAL_WORK_ENTRY
|
static String |
INPUT_PARAMETERS
|
static String |
MAGIC_PROPERTY
|
static String |
OUTPUT_PARAMETERS
|
static String |
RESULT_ENTRY
|
static String |
RUNMODE_PROPNAME
|
static String |
RUNTIME_CONNECTOR
|
static String |
RUNTIME_FUNCTION
|
static String |
TCB_ATTRIBUTE_DEFAULT
|
static String |
TCB_ATTRIBUTE_REQUIRED
|
static String |
TCB_ATTRIBUTE_SYNTAX
|
static String |
TCB_ATTRIBUTE_TARGET
|
static String |
TCB_PERMIT_EMPTY
|
Fields inherited from class com.ibm.di.entry.Entry |
---|
ESCAPE_CHAR, OP_ADD, OP_ADD2, OP_DEL, OP_DEL2, OP_GEN, OP_GEN2, OP_MOD, OP_MOD2, OP_UNCHANGED, OP_UNCHANGED2, PATH_SEPARATOR_CHAR, PATH_SEPARATOR_STR |
Constructor Summary | |
---|---|
TaskCallBlock()
|
|
TaskCallBlock(Entry old,
AssemblyLineConfig alc,
TaskInterface task)
Constructor - Populate object with saved data and current task context. |
|
TaskCallBlock(String assemblyLine)
Constructor - Populate object with assemblyline input/output parameters and connector parameters. |
|
TaskCallBlock(String assemblyLine,
AssemblyLineConfig alc,
TaskInterface task)
Constructor - Populate object with assemblyline input/output parameters and connector parameters, and a task context. |
|
TaskCallBlock(String assemblyLine,
TaskInterface task)
|
Method Summary | |
---|---|
void |
accumulateEntry(Entry work)
Adds an entry to the accumulator object (if any configured). |
void |
applyALSettings(AssemblyLineConfig alc)
Applies the user defined AL settings to the AssemblyLineConfig. |
Entry |
buildInitialWorkEntry()
Constructs a new initial work entry if there are an input parameter specification in the assemblyline. |
Entry |
buildResultEntry()
Builds the result object based on AL's result object and the output parameter specification. |
Entry |
buildTCBEntry(Entry input,
boolean inputMap)
Constructs a new Entry based on the parameter descriptors in params and source attributes in input entry. |
TaskCallBlock |
clone()
Creates a shallow clone of the receiver. |
SchemaConfig |
getALInitializationParameters()
Returns the SchemaConfig for the Published AssemblyLine Initialization Parameters. |
String |
getALOperation()
Returns the AL operation |
OperationConfig |
getALOperationConfig()
Returns the AssemblyLine's OperationConfig for the current operation |
OperationConfig |
getALOperationConfig(String name)
Returns the OperationConfig for the named operation in the AssemblyLine. |
String[] |
getALOperations()
Returns a String[] with names of operations for the AssemblyLine. |
Object |
getALSetting(String paramname)
Returns the AL Settings parameter to value. |
Entry |
getALSettings()
Returns the Entry containing the user specified AL settings. |
AssemblyLineConfig |
getAssemblyLineConfig()
|
String |
getAssemblyLineName()
Returns the assemblyline name this TCB was built from |
boolean |
getBoolProperty(String propname,
boolean defval)
|
Object |
getConnectorParameter(String connectorName,
String connectorParameter)
Returns the current value for a connector parameter as a String |
Object |
getConnectorParameter(String connectorName,
String connectorParameter,
boolean string)
Returns the current value for a connector parameter. |
Entry |
getConnectorParameters()
|
Entry |
getConnectorParameters(String connectorName)
Returns the parameters Entry for a specific connector. |
Entry |
getInitialWorkEntry()
Returns the initial work entry provided by caller |
Entry |
getInputParameters()
Returns the input parameter entry (from the AssemblyLine specification) |
int |
getIntProperty(String propname,
int defval)
|
Entry |
getOperationInitParams()
Returns the operation init parameters |
Entry |
getOutputParameters()
|
Entry |
getResultEntry()
Returns the result entry provided by the caller |
String |
getRunMode()
Returns the runmode |
ConnectorInterface |
getRuntimeConnector(String connectorName)
Returns the runtime connector for a named connector |
FunctionInterface |
getRuntimeFunction(String name)
Returns the runtime function for a named function |
String |
getStringProperty(String propname,
String defval)
|
void |
loadMapping()
Set the Call/Return mapping |
void |
setAccumulator(Object accumulator)
Set the accumulator object to the provided object. |
void |
setAccumulatorObject(Object accumulator)
Set the accumulator object to the provided object. |
void |
setALOperation(String operation)
Sets the AL Operation. |
void |
setALSetting(String paramname,
Object value)
Sets the AL Settings parameter to value. |
void |
setAssemblyLineName(String assemblyLine)
Sets the assemblyline name this TCB applies to |
void |
setComponentEnabled(String name,
boolean enabled)
Set the named component to enabled or disabled status. |
void |
setComponentParameter(String componentName,
String parameterName,
Object parameterValue)
Sets a component parameter. |
void |
setComponentParameter(String componentName,
String parameterName,
Object parameterValue,
boolean protect)
Sets a component parameter, with a possibility to protect the parameter. |
void |
setConnectorParameter(String connectorName,
String parameterName,
Object parameterValue)
Sets a connector parameter. |
void |
setConnectorParameter(String connectorName,
String parameterName,
Object parameterValue,
boolean protect)
Sets a connector parameter. |
void |
setConnectorParameters(AssemblyLine task)
Modifies connector configurations in the AssemblyLine (method is called by AssemblyLine) |
void |
setConnectorParameters(String connectorName,
BaseConfiguration parameters)
Populates the parameter Entry for a specific connector with names from the configuration. |
void |
setInitialWorkEntry(Entry entry)
Sets the initial work entry |
void |
setInputParameters(Entry entry)
Sets the input parameter entry (from the AssemblyLine specification) |
void |
setOperationInitParam(String paramName,
Object paramValue)
Sets an operation init parameter - this call creates the init param entry if not present and adds/replaces the param if one has already been set. |
void |
setOperationInitParams(Entry params)
Sets the AL Operation initialize parameters. |
void |
setOutputParameters(Entry entry)
Sets the output parameter entry (from the AssemblyLine specification) |
void |
setResultEntry(Entry entry)
|
void |
setRunMode(String value)
Sets the runmode. |
void |
setRuntimeConnector(String connectorName,
ConnectorInterface runtimeConnector)
Sets the runtime connector for a named connector. |
void |
setRuntimeFunction(String name,
FunctionInterface function)
Sets the runtime function for a named function. |
void |
setTask(TaskInterface task)
Sets the logger from the given task context |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MAGIC_PROPERTY
public static final String INITIAL_WORK_ENTRY
public static final String RESULT_ENTRY
public static final String CONNECTOR_PARAMETERS
public static final String ACCUMULATOR_OBJECT
public static final String RUNTIME_CONNECTOR
public static final String RUNTIME_FUNCTION
public static final String RUNMODE_PROPNAME
public static final String AL_SETTINGS
public static final String AL_OPERATION
public static final String AL_OPERATION_INIT
public static final String INPUT_PARAMETERS
public static final String OUTPUT_PARAMETERS
public static final String TCB_PERMIT_EMPTY
public static final String TCB_ATTRIBUTE_TARGET
public static final String TCB_ATTRIBUTE_REQUIRED
public static final String TCB_ATTRIBUTE_DEFAULT
public static final String TCB_ATTRIBUTE_SYNTAX
Constructor Detail |
---|
public TaskCallBlock()
public TaskCallBlock(String assemblyLine) throws Exception
Exception
public TaskCallBlock(String assemblyLine, TaskInterface task) throws Exception
Exception
public TaskCallBlock(String assemblyLine, AssemblyLineConfig alc, TaskInterface task) throws Exception
Exception
public TaskCallBlock(Entry old, AssemblyLineConfig alc, TaskInterface task)
Method Detail |
---|
public void setTask(TaskInterface task)
public void loadMapping()
public String getAssemblyLineName()
public void setAssemblyLineName(String assemblyLine)
public Entry getInitialWorkEntry()
public void setInitialWorkEntry(Entry entry)
public Entry buildInitialWorkEntry() throws Exception
Exception
public Entry getInputParameters()
public void setInputParameters(Entry entry)
public Entry getOutputParameters()
public void setOutputParameters(Entry entry)
public Entry getResultEntry()
public void setResultEntry(Entry entry)
public Entry buildResultEntry() throws Exception
Exception
public Entry getConnectorParameters()
public Entry getConnectorParameters(String connectorName)
public Object getConnectorParameter(String connectorName, String connectorParameter)
public Object getConnectorParameter(String connectorName, String connectorParameter, boolean string)
public void setConnectorParameters(AssemblyLine task) throws Exception
Exception
public void setConnectorParameters(String connectorName, BaseConfiguration parameters)
public void setConnectorParameter(String connectorName, String parameterName, Object parameterValue)
connectorName
- The Connector's nameparameterName
- The name of the parameter for the ConnectorparameterValue
- The new value for the parameterpublic void setComponentParameter(String componentName, String parameterName, Object parameterValue)
componentName
- The Component's nameparameterName
- The name of the parameter for the ComponentparameterValue
- The new value for the parameterpublic void setConnectorParameter(String connectorName, String parameterName, Object parameterValue, boolean protect)
connectorName
- The Connector's nameparameterName
- The name of the parameter for the ConnectorparameterValue
- The new value for the parameterprotect
- If true, do not print the value of this parameter in log filespublic void setComponentParameter(String componentName, String parameterName, Object parameterValue, boolean protect)
componentName
- The Component's nameparameterName
- The name of the parameter for the ComponentparameterValue
- The new value for the parameterprotect
- If true, do not print the value of this parameter in log filespublic void setRuntimeConnector(String connectorName, ConnectorInterface runtimeConnector)
public ConnectorInterface getRuntimeConnector(String connectorName)
public void setRuntimeFunction(String name, FunctionInterface function)
public FunctionInterface getRuntimeFunction(String name)
public void setRunMode(String value)
value
- The runmode to set. Legal values are "normal", "record",
"playback", "manual" and "simulate".public String getRunMode()
public Entry buildTCBEntry(Entry input, boolean inputMap) throws Exception
Exception
public void setAccumulator(Object accumulator)
accumulator
- The Object to use as the accumulator object.public void setAccumulatorObject(Object accumulator)
setAccumulator(Object )
public void accumulateEntry(Entry work) throws Exception
Exception
public String getStringProperty(String propname, String defval)
public int getIntProperty(String propname, int defval) throws Exception
Exception
public boolean getBoolProperty(String propname, boolean defval) throws Exception
Exception
public AssemblyLineConfig getAssemblyLineConfig()
public Entry getALSettings()
public void setALSetting(String paramname, Object value)
public Object getALSetting(String paramname)
public void applyALSettings(AssemblyLineConfig alc)
alc
- The AssemblyLineConfig to modifysetComponentEnabled(String, boolean )
public void setALOperation(String operation)
operation
- The AL operationspublic String getALOperation()
public void setOperationInitParams(Entry params)
params
- The AL operationspublic void setOperationInitParam(String paramName, Object paramValue)
paramName
- The name of the parameterparamValue
- The value for the parameterpublic Entry getOperationInitParams()
public void setComponentEnabled(String name, boolean enabled)
name
- The name of the Componentenabled
- True if this component should be enabled, false if it should
be disabledpublic SchemaConfig getALInitializationParameters()
public String[] getALOperations()
public OperationConfig getALOperationConfig()
public OperationConfig getALOperationConfig(String name)
name
- Name of the operationpublic TaskCallBlock clone()
Entry
clone
in class Entry
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |