Application DesignCreate a Business Rule in Configurator

Before you begin creating a business ruleClosed A collection of component sets or business rule components that can be used to incorporate logic or to add, change, or remove data or print parameters after a print request is submitted but before printing occurs. Business rules are similar to form rules, but provide more robust functionality. Business rules are created on the Application Design page and can be designed using the Configurator or programmed using XML. for use with Loftware Enterprise™ SP, you should identify the decision points, constraints, and sources of data that impact labels and printing. If you identify a need for business logic beyond what can easily be incorporated into data sources in a label template, then you may need a business rule. You can use the information that you have collected about your organization's procedures for printing labels to create business rules to support those procedures.

A Component Set: A Trigger and Component Blocks

Each business rule created in the Configurator view is composed of one or more component sets. Each component set consists of a triggerClosed A means of running an action, rule, or data service. Includes a trigger source if interactive (such as a button, a prompt, or a form) and a trigger event (such as clicking a button, entering text at a prompt, loading a form, or submitting a job). For example, you can specify a particular button as a trigger source that Data Providers can click to perform a query of a database. and one or more component blocks. When a processClosed An object in Loftware that binds together all of the components to be used when responding to a print request. Among other items, those components may include a label template, layout, device, and a business rule to be used when processing a print request. Processes are created in the Process Design page. runs a business rule, a particular component set within it is run when the event that serves as its trigger occurs. For example, if the trigger for a component set is Job Submission, then that component set is run if and when a job is submitted.

Each component set can contain component blocks, each of which performs an action. For example, a Get First Row block can retrieve a row from the result of a query of a JDBC data service and save it to the data mapClosed A repository for the data for use when responding to a print request. Each data map entry is composed of a name (key) and a value..

You can use a reusable ruleClosed A solution that provides support for a device for which neither the family nor model is displayed in Devices. It typically includes a Generic device, a label template, and any business rules or processes required to run the device. to add a commonly-used component set to a business rule.

Component Block Order

Within each component set, the component blocks are run in the order in which they are displayed in Configurator. You can drag and drop component blocks to rearrange their order.

Note: If you require that a business rule have additional capabilities or flexibility beyond what is possible by using Configurator, a programmer can use XML to develop a business rule. For more information, see Implementing Business Logic.

Create a Business Rule

To use the Configurator to add a business rule to Loftware Enterprise SP, do the following.

  1. In Application Design , in the ribbon click Add > Business Rule to create a new business rule.
  2. In the Properties pane, enter a Description of the business rule, including its purpose.
  3. Name the business rule by performing the following steps.
    1. Click File > Save or click the Save button in the toolbar to save the business rule.
    2. In the left pane of the Save dialog box, click the folder in which you want to save the business rule. You can click a folder to display subfolders.
    3. Enter a name for the business rule in the Name box, and then click OK.
  4. Create component sets by performing the following steps.
    1. In the Triggers pane, click Add and then select the event that should cause the component set to run. A box representing the component set, named for the event that serves as the trigger for it, is displayed in the Triggers pane.

      Note: When creating a Custom trigger, you must enter a name for the trigger. This must match the name of a Custom event so that an occurrence of the event can cause the component set to run. Alternatively, you can run a Custom component set without an occurrence of the Custom event by using a Run Another Component Set or Run Another Business Rule block.

      Tip: For information about each type of event that can serve as a trigger, see Triggers in the Configurator.

    2. Repeat for each event that you want to trigger a component set in this business rule. The name of each event must be unique within the Triggers pane.

      Tip: To delete a component set (including its trigger and any component blocks), select the trigger of the component set that you want to delete, and then click the Delete button for that trigger.

  5. Create component blocks that perform actions within a component set by performing the following steps.
    1. In the Triggers pane, click a trigger. Any component blocks associated with that trigger in this business rule are displayed in the Configurator pane in the order in which they are run when the trigger event occurs.
    2. Add a component block by clicking the Insert tab and from the ribbon dragging a component block representing an action to perform into the Configurator pane and dropping it onto a Drop block here marker.

      Tip: For information about each type of component block and its properties, see Component Blocks.

    3. In the Configurator pane, configure the properties of the new component block.

      Best Practice: It is suggested that you click File > Save or click the Save button in the ribbon to save the business rule after adding each component block.

    4. Drag and configure any additional component blocks needed to perform actions for the component set. The component blocks within a component set run in order beginning with the one at the top. You can drag and drop the component blocks in the Configurator pane to change the order in which they run.

      Tip: To delete a component block, select the component block, and then click the Delete button in that block.

    5. Repeat for each component set.
  6. Click File > Save or click Save in the ribbon.

Next, a process must be created to run the business rule and receive data from it.

  • If you are not responsible for creating processes, contact an administrator, provide the fully-qualified name of the business rule that you created, and request the creation of a process to run the business rule.
  • If you are responsible for creating processes, create a process and configure it to run the business rule. For more information, see Create a Simple Process, Create a Generator Process, or Create a Reprint Process.