Other Binds

Business rules can use any of the following 'Other' binds.

Each bind is defined in the sections below.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule or Library topic here.
  2. Edit the business rule as defined in the Editing a Business Rule topic here.
  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic here.
  4. In the Edit Operation dialog, optionally add Messages, as defined in the Adding a Localized Business Rule Message topic here.
  5. In the Edit Operation dialog, add JavaScript to call the bind.

Important: The example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system.

Conditionally Invalid Values

This bind is used with Conditional Attributes. For more information, see the Business Rules with Conditional Attributes documentation here.

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

Import Change Info

Use this bind when the business rule is running in an import. It accesses what has changed with the import (for example, new / existing objects, updated attributes). This object will be populated for each object in the import.

The object contains two members:

isUnmodified()
getChanges()

Logger

This is 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)

For more information, see the Using JavaScript with Lookup Tables documentation (here) and the Transformation Lookup Tables topic in the System Setup / Super User Guide (here).

Mail Home

This bind allows the JavaScript to send emails. The bound class is the API Mail Home object.

Binds to the MailHome domain interface available for actions and conditions (although typically used with actions). After mail server settings are configured on STEP, this bind allows sending of emails that support full HTML.

In this example, 'Mail Home' is bound to the variable 'mailHome'.

mailHome.mail()
.from("Address of Sender")
.addTo("Address of Recipient", "Common Name")
.htmlMessage("Full HTML message:)
.subject("Subject of Email")
.send();

2018, Stibo Systems