Step Selection can be custom logic that selects the next step based upon several business scenarios, such as multiple next step selection or nonconforming product. This allows users to customize the routing flow with very complex decision criteria. This custom logic can be accomplished by associating a coded routing script with any branch on a routing.
The scripting language is interpreted JavaScript. The scripts can make Enterprise Java Beans (EJB) calls or Structured Query Language (SQL) queries if needed. Each script is associated with the paths between steps. The scripting language is basically normal JavaScript, but there are some differences. All variables must be defined before using them. There is no access to the GUI. The exit() method is used to return a value to the next step logic.
There are a number of convenience methods (callEJB() and getEJBProperties(), getItemProperties(), getCustomItemProperties()) that make direct calls to EJBs. A large amount of data is also available to these scripts to help make next step decisions.
Double-click the line that represents the path to display the scripting dialog box.
The following routing scripts are loaded with the system:
Failure
// Path for SFCs that fail
if(NC_CODE!=null) {
exit (true);
} else {
exit(false);
}
No Open Nonconformances
// Path for SFCs without open Non-Conformances
if(getOpenNCs()!=null) {
exit (false);
} else {
exit(true);
}
Open Nonconformances
// Path for SFCs with open Non-Conformances
if(getOpenNCs()!=null) {
exit (true);
} else {
exit(false);
}
Note
Scripting is disabled for security reasons by default. For more information, see
in SAP ME 6.0 Security Guide at .