In this example, we'll show you how to change a processor's routing based on an item's itemtype.
Create a Simple Model
- Create the simple model as shown above.
- Double-click on the Source to open its properties window.
- Go to the Triggers tab and press the next to the OnCreation trigger and select the Set Itemtype and Color option.
- Leave the values at their default and press the Ok button on the Source Properties Window to apply the change and close the window.
Sample an Item
- Reset and run the model until an item appears.
- Stop the model.
- Click on the Processor to display it's properties in the Quick Properties window.
- Under the Output section of the Quick Properties, click the next to Send to Port to enter "Sample Mode".
- Click on the item in your 3D view and the following menu will appear:
- Select the getitemtype(item) option.
The Sampler will automatically insert the correct line of code for referencing the item's itemtype into the Send to Port picklist.
Reset and Run the model to see how it works.
Note: You may also open the Flowitem Bin and Sample flow items from there. If you are sampling labels on a Flowitem, keep in mind that the options the Sampler will give contain all of the labels on all of your Flowitems. It does not distinguish between flow items.