You are here: Business Rules > Business Actions > Execute JavaScript > Other Binds

Other Binds

Business Actions and Business Conditions can use any of the following binds.

Bind Name

Description

Conditionally Invalid Values

Use with Conditional Attributes.

For details about this bind, see the conditional attribute section of the Business Rules documentation here.

For information about creating conditional attributes, see the Conditional Attribute Handling section of the System Setup / Super User Guide here.

Import Change Info

Use when the Business Rule is running in an import; accesses what has changed with the import (for example, new / existing object, updated attributes). This object will be populated for each object in the import.

The object contains 2 members:

isUnmodified()
  • true when an object is unchanged by the import
  • false when the object is new or modified
getChanges()
  • returns a 'changes' object with a getAttributes() method that lets you see which Attribute values are changed by the import

Logger

Shorthand for the Java Logger class, Logger writes to the main STEP log file on the application server (step.*.log) when the condition or action runs. This variable is always bound in, gives access to a java.util.logging.Logger object, and allows logging of messages at the following severity levels:

logger.fine("Message to log");
logger.info("Message to log");
logger.warning("Message to log");
logger.severe("Message to log");

By default, the STEP log does not register messages at the 'fine' severity level.

After development and debugging a new Business Rule, including the Business Rule ID and the context in the log message aids in troubleshooting when required.

Note: When testing a business rule, Logger writes directly to the test dialog, not to the STEP log file.

Lookup Table Home

The interface has a single public method that returns a String containing either the lookup value or the original value if no match could be made:

getLookupTableValue(String assetID, String value)
  • The first argument is the ID of the lookup table (an asset)
  • The second argument is the string for which you want to get the lookup value.

For more information, see the Using Lookup Tables section of the Business Rules documentation here.

Mailer

Allows the JavaScript to send emails. The bound class is the API Mailer object.

Binds to the Mailer domain interface available for actions and conditions (although typically used with actions). After mail server settings are configured on STEP, this bind allows sending simple emails.

In this example, 'Mailer' is bound to the variable 'mailer'.

mailer.send("yourfriend@work.com ", "someone@somewhere.com", "Hello! ", "Please use Web UI to review the imported items.");

2017, Stibo Systems