Business Rule

BusinessRule general information

A BusinessRule (formerly known as SolutionExtension, SX or UX) is a piece of code which can act on an action in Planon. It can extend Planon functionality where needed.

For more general information please visit: https://webhelp.planoncloud.com/en/index.html#page/Platform%20apps/c_pp_business_rule.html

A BusinessRule can be compared to a trigger of a database. It can be configured in Planon on a BusinessObject (BO) to react on changes on that BO when the BO is read, saved or deleted.

A BusinessRule can be created in a developer environment by using Java code. This is time consuming and similar solutions must be created all over again each time.

This Logic Flow Builder solution will prevent that. Logic can be created very quickly and easily in a visual editor by dragging and dropping functions which will lead to the logical flow. This configuration can be exported and imported to other environments which also have this app installed. There is no need to program Java code anymore so it can also be used by functional consultants and customers.

Behavior of Before and After registrations

The following statements are true:

  • When registering an action on “Before”, all the changes which are being made on the changing New (UD)BO are saved automatically afterwards. Therefore DO NOT manually save the triggering BO.
  • When registering an action on “After”, all changes are not being saved automatically. An explicit save function on the triggering BO must be executed in the end.
  • Changing values of the “Old” will have no effect. The old value is purely for reading values.
  • When jumping to another BO, for example a Property, that Property is not saved automatically anymore. This must explicitly be done by adding a save function.

LFB business rules

The app comes with business rules that are responsible for the execution of logic created through the configuration via the visual editor. The business rules need to be configured on the Business Object in the field definer on which the logic needs to be executed. See Registering business rules for the configuration steps.

planonsoftware.apps.configurablebusinessrule.ConfigurableBusinessRule

To use this business rule a free module is needed first. Planon configuration explains in more detail which fields are needed. When registering the rule to the preferred BusinessObject (where you want to build the logic) there is only one setting available, which is the configuration code. This field holds the code of the configuration stored in the free module. The business rule fetches the configuration from that referenced free module record.

If the free module is configured and all helper business rules are in Planon, a new configuration can be created:

Provide a Code and a Name / Description and after saving the URL will be automatically populated.

Clicking on the link button on the right of the URL will open the editor. This time it is automatically linked to the configuration itself and therefore can be saved and reloaded directly from the editor. 2 extra buttons will be available in the editor to do so.

The generated URL will look like this:

https://<environment>/services/sdk/platform/webpages/planonsoftware/apps/configurablebusinessrule/module/editor?id=New

id=New is the actual link to the new free module record.

Registering:

  1. Go to the TSI Field Definer.
  2. Select the Business Object on which the business logic needs to be performed.
  3. Set the BO to Under Construction.
  4. Go to Details Level and Extension selection step.
  5. Click on Add extension.
    • Select the extension ConfigurableBusinessRule from the Class Name reference popup.
    • Go to the settings tab and provide the configuration code just created. In this case “New”.
    • Provide other mandatory fields like Event, Sequence etc. as per business needs.
    • Save the changes.
  6. Now set the BO back to Completed state.

ConfigurableStandaloneBusinessRule

planonsoftware.apps.configurablebusinessrule.ConfigurableStandaloneBusinessRule

Alternative to the recommended ConfigurableBusinessRule also a static configuration can be done in case the environment does not have the Free module configured.

This rule comes with a parameter which holds the complete configuration created in the visual editor. This version stores the configuration in the field definer registration itself. The configuration from the visual editor must therefore be copied manually whenever it is changed.

Open the standalone editor in your browser:

https://<environment>/services/sdk/platform/webpages/planonsoftware/apps/configurablebusinessrule/module/editor

The following page will be shown:

Once the configuration is created as per the business logic, click on Import Export, which shows the complete logic in the form of a JSON. This JSON needs to be configured on the Business Object on which the business logic needs to be executed. It is also possible to download the configuration using the download button.

  1. Go to the TSI Field Definer.

  2. Select the Business Object on which the business logic needs to be performed.

  3. Set the BO to Under Construction.

  4. Go to Details Level and Extension selection step.

  5. Click on Add extension.

    • Select the extension ConfigurableStandaloneBusinessRule from the Class Name reference popup.
    • Go to the settings tab and configure the JSON copied from the visual editor.
    • Provide other mandatory fields like Event, Sequence etc. as per business needs.
    • Save the changes.
  6. Now set the BO back to Completed state.