Emit – Create Textual Outputs Like Print

General

The emit statement prints a string or a comma-separated sequence of strings to the Output pad. Output argument(s) that are not of type string are casted to string, so all types can be output.

Example code:

1  rule createBOMHierarchy{      //LHS
2  
3    child:Part;
4    parent:BomNode;
5    
6    if {parent.id == child.parentid && parent.productid == child.productid; }
7
8    modify{                      //RHS
9       parent -:Contains-> child;
10      emit("Child node "+child.id+" connected to parent node "+parent.id+"\n");
11   }
12 }

The above example would result in an output like “Child node 2740253 is connected to parent node 200031.”, given that 2740253 is child.id and 200031 is parent.id. This code example can be found in our Soley Studio Tutorial.

How to use it:

More Examples can be found in these Packages:

BoM-Kit

Was this article helpful?

Related Articles