GitHubContribute in GitHub: Open doc issue|Edit online

Basic Use

The Task Call Block (TCB) is a special kind of Entry object used by a caller to set a number of parameters for an AssemblyLine. The TCB can provide you with a list of input or output parameters specified by an AssemblyLine, including operation codes defined in the Operations tab of the AssemblyLine, as well as enabling the caller to set parameters for the AssemblyLine's Connectors. The TCB consists of the following logical sections:

  • The Initial Work Entry passed to the AssemblyLine: tcb.setInitalWorkEntry()
  • The Connector parameters: tcb.setConnectorParameter()
  • The input or output mapping rules for the AssemblyLine, which are set in the Config Editor under the Operations tab
  • An optional user-provided accumulator object that receives all work entries from the AssemblyLine: tcb.setAccumulator()

For example, starting an AssemblyLine with an Initial Work Entry and setting the filePath parameter of a Connector called MyInput to d:\myinput.txt is accomplished with the following code:

var tcb = system.newTCB();                       // Create a new TCB
var myIWE = system.newEntry();                   // Create a new entry object
myIWE.setAttribute("name","John Doe");           // Add an attribute to myIWE
tcb.setInitialWorkEntry ( myIWE );               // Set the IWE and parameters
// Note that since this is a JavaScript string, we must "escape" the forward slash
//      or use a backslash (Windows syntax)
tcb.setConnectorParameter ( "MyInput", "filePath", "d:\\myinput.txt" ); 

var al = main.startAL ( "MyAssemblyLine", tcb ); // Start the AL with the tcb
al.join();                                       // Wait for AL to finish