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:
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 AssemblyLine with the tcb al.join(); // Wait for AssemblyLine to finish
Parent topic: Task Call Block (TCB)