Logic Flow Builder

Formerly known as Configurable BusinessRule.

Introduction

A BusinessRule (formerly known as SolutionExtension,SX or UX) is a piece of code which can act on 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]

BusinessRule can be compared to Triggers of a database. It can be configured in Planon on a BusinessObject (BO) to react on changes on that BO after the BO is saved.

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

This Logic Flow Builder solution will prevent that. Logics can be created very quickly and easy 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.

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.
  • When registering an action on “After”, all changes are not being saved automatically. An explicit save function 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 Property, that property is not saved automatically anymore. This must explicitly be done by adding a save function.

Prerequisites

Environment

This solution will be designed to work with Planon Live 105 and above.

Constraints

  • Only the app itself is technically supported by Planon support. Configurations itself which are created with this app are not supported by Planon support.
  • Like with any addition to the system, each addition brings a certain performance impact. Therefore, adding business rule configurations is always limited.
  • There might be combinations and/or certain configurations that introduce issues which cannot be solved.
  • States in Planon can only contain AlphaNumeric characters and space. Unfortunately this is not (yet) a constraint in Planon itself.
  • Functions marked with the  tag are in intial state. This means those are not as mature as other functions. If any issues occur while using these Beta function, please create a ticket with support. We will attempt to resolve the problems, but priority will at all times be given to the non-beta functions.

Required (free)fields

This app will make use of a (optional) free module. This can be every module which is still available in the environment. The actual free module used can be configured in the modulesettings.

Components of App

Visual Editor

This app contains of a visual editor which will make it intuitive and easy to use. Configuration can be created by dragging and dropping functions to the panel.

The left side (red outline) contains all functions which are available and can be dropped on the flow panel on the right side (green outline).

Action buttons

The buttons on the top can be used for:

  • : Remove every configured (on right screen) function from the flow.

  • : Save the flow to Planon.

  • : Reload the flow from Planon. All changes will be discarded.

  • : Shows a popup to import and export the configuration.In this popup it is possible to copy or download the current configuration. When providing (pasting) the configuration it can also be imported easily. This way it is very easy to share configurations between environments and customers.

  • : Go to in app manual page. Functions manual will be generated dynamically.

Manual

A manual of all functions will be dynamically generated in the app. To access this documentation click the I (information) button or click the Logic Flow Builder visual editor header. It is also possible to directly go the the specific function in the manual by clicking the on the bottom of every function.

[https://[environment]/services/sdk/platform/webpages/planonsoftware/apps/configurablebusinessrule/module/manual]

In-App manual page

This app will also contain a manual page which is mainly autogenerated. This page will contain several tabs which will give extended information about functions, release notes and license usage. This manual can be reached by clicking the button in the editor.

Tip: this page will be opened in a separate tab and can be put on another screen to have direct access next to the editor.

Functions

All available functions will be autogenerated. This means the documentation is always up to date.

Release notes

Release notes will contain updated and new functionality. This way it is possible to check in which version a specific function is created or changed.

License usage

This page will show the current license usage. The app license contains an amount of licenses which can be used. License usage will be counted by the following rules:

  • BusinessRules: each unique combination of System BusinessObject and Configuration will count as a single license.
  • SchuduledTasks: each registration with a unique configuration will count as a single license.
  • BusinessEvents: each registration with a unique configuration will count as a single license.
  • Incoming Webservice: each unique configuration, which is marked as a webservice, will count as a single license. Note: This option is not available in the standalone version.
  • TSI-Action: each registration with a unique configuration will count as a single license.

Functions

Each function has its own purpose and logics. The description will give a brief explanation about the logics and the manual can be consulted for more information.

The following parts can be distinguished within a basic function:

There are also functions available which have multiple inputs and/or outputs.Those functions are called collector functions because they can have an unlimited amount of input connections on input 1.

The following function is an AND function, as example, which can have 1 or more input booleans on input 1. If all input values are TRUE, output 1 will be called. In all other cases output 2 will be called.

Input 2 can be manually called to force the execution of the function. See next chapter Logical flow for more information.

Logical flow

Each flow will always start with the “Start of flow” node. This special node has several parameters:

App version: this will show the saved version of the configuration.

Function size: select the view-type of the functions.

Full: Show full-size function with all editable fields.

Simple: Show a summary of all selected values.

Small: Show only title of function.

Solution type

BusinessRule: Create a business(logic) rule to perform automation within Planon.

Advanced (level 3 only):

ScheduledTask: Schedule a task on a specific moment in time.

BusinessEvent: Create logic based on the decision model.

Incoming webservice: Create logic on an incoming webservice event.

Webservice response: In case a external webservice is called from the CBR this type can be used to process the response.

TSI-Action: Create logic which will be trigger by a TSI-Action (button in action menu).

SubConfiguration: A subconfiguration which can be called from the base configuration. This can be used when specific logics must be executed in different solutions.

BusinessObject available which can be used to enable autocompletion on BO’s and fields. Once provided it also enables checks on fields, so it should not be possible to provide a non-existing field.

Depending on the solution several functions can be added and connected with so called connections.

The flow execution of the functions is from left to right and top down.

Note: each connection will be executed which means duplicate connections between functions will also result in double executions. The following example will show that the person will be saved twice which is not intended:

There are 2 possibilities to make this work, remove the top connection because the save must be executed after the update of the second field:

Or connect all functions in a sequence:

As previously indicated, the order of execution is determined topdown by the position of the sub-function as seen from the current function. This will be illustrated in the following example:

Start of flow will check which subfunction is on top. In this case value 1 so the output here will be “1-2”.

In this example, value 2 in on top so the output will be “2-1”.

Collector functions

As discussed before, collector functions will be used to collect multiple inputs to combine into an output value.

The system will gather input values on input 1 and when all logic has been executed all collector functions will be executed automatically by the Start of flow function.

The following example will combine several fields to one output field Email and will illustrate the flow which will go wrong. FirstName = “Steve”, LastName = “Weller”

As shown above the concatenate functions will be executed after step 6 which will result in adding “planonsoftware.com” first to the second concatenate function. After that the first concatenate function will be executed which will give the second input “Steve.Weller” to the second concatenate function. The result in the output will be in this case which is incorrect.[planonsoftware.com@Steve.Weller]

To solve this problem an input 2 is being created. This input can be executed manually so it is possible to force the correct order of executions. Example:

In this example an extra step 5 is created to be executed. The function get field value of LastName will first provide the LastName to the concatenate function and afterwards it will also call the second input of the concatenate. This will result that the concatenate will directly be executed, and the output is pushed to the second concatenate. This configuration will result in the correct outcome: [Steve.Weller@planonsoftware.com]

Best practice is to always connect the second input of a collector input to make it controllable and prevent creating “unexplainable” logics. Make sure to connect it to the previous function when all inputs are being provided.

Convenience functions

Each function has its own (mosly) simple task. In configurations some combinations of functions are frequently used. To prevent the unnecessary adding of all those functions, convenience functions are introduced. Those functions are most of the time marked.

(S) Static version of the function. A direct parameter function is added to the functions so it can be provided directly.

(ITE) Those functions have already a if-then-else function included. If the outcome of the base version is true output 1 will be called and otherwise output 2.

The following example will give an example of simple functions and the more advanced convenience functions:

Flow 1 is basic. 3 functions are needed to check if LastName is changed and if that is the case show the warning.

Flow 2 has 2 functions (Static String & Field Changed) of flow 1 combined in 1 convenience function (Field changed (S)).

Flow 3 has only 1 function which has combined Field changed (S) and If-then-else.

Disabling functions

Functions can be easily disabled by checking the disable checkbox on a function or clicking Enable/Disable in the context menu of the function. When disabling a function all following functions will also be automatically disabled. Once disabled a function will be transparant in the editor.

Note: *Because of the regular automatic reload of the Planon framework the editor will also be reloaded. *To fix this the configuration will automatically be saved in the browser storage on every save. After clicking the save button the configuration will be saved to the database. When clicking the reload button the configuration will be loaded from the database again.

Editor controls

  • Delete key Remove selected
  • Esc Deselect functions
  • Ctrl + Wheel Zoom
  • Ctrl + S Save configuration
  • Ctrl + A select all functions
  • Ctrl + C copy selected functions
  • Ctrl + P paste functions which are copied. This is also possible in another configuration.
  • Ctrl + left mouse Multi select functions
  • Dbl L-click line Add/remove shaping item
  • R-click on canvas deselect functions.

Business Rules

The app comes with business rules that are responsible for execution of logic created through the configuration via the Visual Editor. The business rules needs to be configured on the Business object on which the logic needs to be executed.

The app comes with two business rules

ConfigurableStandaloneBusinessRule

This rule comes with a parameter where the configuration created from visual editor needs to be copied during the configuration of the rule on the Business Object. The configuration from Visual Editor must be copied manually whenever it is changed.

Chapter 9 provides the details of the configuration

To use this businessrule a free module is needed first. Chapter 8 will contain the configuration needs of that free module. 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 will hold the code of the configuration stored in the free module (when used). The businessrule will fetch the configuration from that referenced free module record.

Planon Configuration

This chapter explains the necessary steps to use optional free module based business rules. This is not needed if the decision is made to use standalone business rule.

Firstly we would need a free business object to use free module based business rules.

Once the free BO is chosen, create a UDBO with any name (preferably UsrConfigurableBusinessRules)

Set the below fields to In Use

DescriptionSystem nameField TypeUniqueComments
CodeCodeTextYesUnique code to identify the configuration. Ideally this field is auto provided by a codegen.
NameNameTextNoFunctional description of configuration
Visual Editor URLFree String of length 255NoAutogenerated URL field which will contain the link to the visual editor.
ConfigurationStringExtendedNoData field which will hold the configuration.

Once the Business Object configuration is created, it needs to be added to a TSI. The required configuration steps can be found from [here]

Example free module:

Installation

This chapter described the steps required in order to install this app on your Planon environment.

Installation Process

There are two ways to install the app;

Install the app by using the marketplace

In case your environment is configured to use the Planon appstore the only thing required to install the app is to add the app license in the AppCenter TSI. Planon will automatically download and install the app.

Manual installation

In case you want to perform a manual installation follow the steps below.

  • Open AppCenter TSI from Planon webclient and click on install from action menu.

  • Browse the .ppk file

  • Click OK to install the app and follow the installation process.

  • When the app is successfully installed, the app will appear in the AppCenter.

  • Add the app license in Apps TSI

  • Link App to usergroup

Activation

Once the app has been configured you can activate the app by pressing the ‘Active’ status transition from the action panel.

App settings

Module settings

This chapter describes and explains the settings that are available for this app.

Now that the app is installed we can provide the app settings for each module in the ‘modules’ selection level. Provide the module settings (the app configuration) which is available in the **Details **section.

Click Save button after providing the module settings.

Description of settings

SettingValuesDescription
aiDocumentationCommandStringText to generate AI command for creating documentation.
configurationBOStringSystemname of used (free) module which will be used to store the configurations.
configurationDataFieldStringActual datafield in (free) module to store the configuration JSON from the visual editor. Recommended is to use a ExtendedString field here because the configurations can get large.
configurationHistoryBOStringSystemname of (UD)BO which will be used to store each history version while saving.
configurationHistoryBODataFieldStringActual datafield in (free) module to store the history version configuration JSON from the visual editor. Recommended is to use a ExtendedString field here because the configurations can get large.
configurationHistoryBODateFieldStringDatefield which will contain the timestamp of the history record.
configurationHistoryBOLinkFieldStringLinkfield to the actual configuration.
configurationIsWebserviceFieldStringFieldname of yes/no picklist field to determine the configuration is used for an incoming webservice.
configurationKeyFieldStringKeyfield of the (free) module. This field will hold the unique ID of the configuration which the businessrule configuration can use for execution.
configurationUrlFieldStringSystemname of field which will hold the autogenerated url to the visual editor pointing to that specific configuration.
debugLogStorageFieldStringFieldname of document field which will hold the debug information. Once this setting is provided a debug button will be visible in the editor. After clicking the button the debug information of the last run will be showed in the editor. See chapter Debugging for more information.
defaultExperienceLevelStringDefault experiencelevel which will be part of the generated url.
encryptionPasswordStringEncryption password which will be used to encrypt/decrypt passwords in the configurations.
fileBasePathStringBase filepath which will be used for references to files.
multiPicklistCodeStringCode configuration which will be executed after adding or deleting a multipicklist. In the configuration it is possible to check the action and multipicklist type. This is because it is not possible to register a businessrule on those (UD)BO’s in Planon.
printExecutionTimesAsInfoInLogStringIf this option is enabled the execution times will be showed in the Wildfly/Tomcat logs to monitor delays.
urlStringDefault URL template which will be generated for each configuration.

Example settings

Component settings

This app consists of 4 business rules each having its own very basic configuration.

planonsoftware.apps.configurablebusinessrule.ConfigurableStandaloneBusinessRuleActual BusinessRule which will execute the logics created in the editor. This version will store the configuration in the field definer registration itself. (See chapter 9.1)

planonsoftware.apps.configurablebusinessrule.ConfigurableBusinessRuleActual BusinessRule which will execute the logics created in the editor. This BusinessRule is dependent on the extra free module which must be configured in Planon once. (See chapter 5 and chapter 9)

planonsoftware.apps.configurablebusinessrule.GenerateURLThis is a helper BusinessRule which can be configured on the new configuration BO (free module see chapter 9) to autogenerate the URL to the Visual Editor each time the configuration is saved.

planonsoftware.apps.configurablebusinessrule.CreateHistoryThis is a helper BusinessRule which can be configured on the new configuration BO (free module see chapter 9) to automatically create a history record each time the configuration is saved (in the editor).

How to use

Creating the configuration

Once the app is activated, one can start using the app.

Using standalone version

The basic visual editor can be found on the following url:

[https://[environment]/services/sdk/platform/webpages/planonsoftware/apps/configurablebusinessrule/module/editor]

This editor does not have all functionalities yet because of lacking the configuration BO. It can now only be used as a stand-alone version.

Using free module based version

Once the BO is configured as explained in the chapter 5, opening the editor with reference to this configuration displays extra buttons for saving or reloading the conifguration of business logic.

To use with reference of the free BO, a free BO record needs to be created in the configured TSI. The url with reference to free BO record with code ORDER_INSERT will be as below

[https://[environment]/services/sdk/platform/webpages/planonsoftware/apps/configurablebusinessrule/module/editor?id=ORDER_INSERT]

The app also comes with a business rule to auto generate this URL when a free BO record is created. The details of the business rule configuration will be explained in chapter 9.

Register BusinessRules

Now all nessecary steps are completed and a first configuration can be made. Depending on the choice whether to use a free module the next subchapters will give a brief description of how to start.

ConfigurableStandaloneBusinessRule

Visit the following link in your browser:

[https://[environment]/services/sdk/platform/webpages/planonsoftware/apps/configurablebusinessrule/module/editor]

The following page will be showed:

Once the configuration is created as per 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. Also, one can download the configuration in a download using the download button.

- Go to the TSI Field Definer
- Select the Business Object on which the business logic needs to be performed.
- Set the BO to Under Construction
- Go to Details Level and Extension selection step
- Click on Add extension
  - Select the extension **ConfigurableStandaloneBusinessRule** from the Class Name reference popup
  - Go to settings tab and configure the json copied from Visual Editor
  - Provide other mandtory fields like Event, Sequence etc as per business needs
  - Save the changes
- Now set the BO back to Completed state.

GenerateURL

This is an optional business which can be configured on the free BO to autogenerate a url with reference to the free BO record.

Below steps shows the configuration details

- Go to the TSI Field Definer
- Select the Free Business Object configured
- Set the BO to Under Construction
- Go to Details Level and Extension selection step
- Click on Add extension
  - Select the extension **GenerateURL** from the Class Name reference popup
  - Go to settings tab and configure the json copied from Visual Editor
  - Provide other mandtory fields like Event, Sequence etc as per business needs
  - Save the changes

ConfigurableBusinessRule

As explained in the previous chapters, this business rule is used only when free module is configured.

If the free module is configured and all convenience businessrules 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.

History Business Rule

To automatically save a history record on each save of the configuration this BusinessRule (planonsoftware.apps.configurablebusinessrule.CreateHistory) can be configured on the configuration BO

Trigger type : BeforeDBUpdate

Tips & Tricks

This section will give some tips in easy working with this app.

Comments

A special comments (post-it) function is created to make it possible to have some disciptive notes in a flow.

Warning

While creating a configuration in the editor a simple way of “debugging” can be used by adding a warning in strategic points in the flow. (Note: in version 2.8.0 a new way of debugging is introduced) In the following example the warning will check the actual value of the LastName field which is read. By adding the ‘%s’ in the Message field, the input will be showed as text.

When executing the businessrule (doing the actual action in Planon) the warning will be displayed.

As long as Proceed is not clicked the logics will stop at this point. The process can be repeated as many times as necessary.

Troubleshooting

This chapter describes common things and known issues to check in case the app is not working as expected.

  • Configuration has been tampered with -> This check is to prevent manual modification of the configuration. In some cases an update of the app can cause this message. This can be easily solved by opening de configuration in the editor and save it again. This way the new checksum will be calculated and inserted to the configuration.

Debugging

After configuring the debugLogStorageFld setting AND loglevel is set to DEBUG an extra button will be available in the editor.

Each execution of the configuration will save the debug configuration in the configured field. After clicking the button the execution datetime will be showed in the button:

The last run path will be showed in the editor. Each line which has been executed will be marked green.

In case of an error the error error path will be showed with red lines. The debug icons on the functions will also turn red. When hovering the debug icons the error will be showed:

If no debugLogStorageFld is set the debug output will be showed in the wildfly/tomcat log:

Error handling

**Important note: **

In case of a problem/bug of the App the following steps must be considered:

  • Make sure you use the latest version of the app. In AppCenter, after selecting the App, click update to automatically update the App.
  • Re-test the issue in the new version.
  • If the issue still occurs, communicate the following information to Planon:
    • Version of the App
    • Screenshot of the complete flow
    • Copy of the configuration. This can be copied via import/export button in the editor. There are several error/logging options:

The visual editor will directly show error while configuring such as field, states or BOs which are not available.

Fields will turn red if something is wrong once leaving the field.

Popups will be shown if something is wrong while saving.

While executing the BusinessRule configuration in Planon regular message will be shown if something is wrong.

Wildfly log will contain errors. To have a debug output of the app change the App log level on the app in the AppCenter.When executing the BusinessRule in Planon a flow log will be added to the WildFly or Tomcat log to see the exact steps.

Examples

Copy field to another field

This example will copy the LastName to the FirstName of a Person but only if the LastName has changed and it not empty.

Steps:

  • Check if LastName is changed. Link output 1 because we want to check if changed = true.
  • Check if LastName is not empty. Link output 2 because we want to check if empty = false.
  • Get value of LastName field.
  • Set Value of FirstName field.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"15":{"id":15,"name":"Start of flow","data":{"basebo":"Person","undefined":"Person"},"class":"start","html":"","typenode":false,"inputs":{},"outputs":{"output_1":{"connections":[{"node":"19","output":"input_1"}]}},"pos_x":26,"pos_y":199},"17":{"id":17,"name":"Get field value (Static)","data":{"dataobject":"Target","elementname":"LastName"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"20","input":"output_2"}]}},"outputs":{"output_1":{"connections":[{"node":"18","output":"input_1"}]}},"pos_x":909,"pos_y":350},"18":{"id":18,"name":"Set field value","data":{"dataobject":"Target","elementname":"FirstName"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElement","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"17","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":1198,"pos_y":325},"19":{"id":19,"name":"Field changed (ITE)","data":{"dataobject":"Target","elementname":"LastName"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.ElementChangedStaticIfThenElse","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"15","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"20","output":"input_1"}]},"output_2":{"connections":[]}},"pos_x":312,"pos_y":321},"20":{"id":20,"name":"Field empty (ITE)","data":{"dataobject":"Target","elementname":"LastName"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.ElementEmptyStaticIfThenElse","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"19","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]},"output_2":{"connections":[{"node":"17","output":"input_1"}]}},"pos_x":606,"pos_y":321}}}}}

Copy field to another field (Convenience function)

Because 7.1 contains 4 steps to do this action this would be very laborious to do on every copy.

A more intelligent convenience function is created to solve this. It includes all the steps from 7.1 and has also some more options to check.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"15":{"id":15,"name":"Start of flow","data":{"basebo":"Person","undefined":"Person"},"class":"start","html":"","typenode":false,"inputs":{},"outputs":{"output_1":{"connections":[{"node":"21","output":"input_1"}]}},"pos_x":26,"pos_y":199},"21":{"id":21,"name":"Copy value of field","data":{"dataobject":"Target","targetdataobject":"Target","elementname":"LastName","targetelementname":"FirstName","sourcenotempty":"true","sourcechanged":"true"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.CopyElement","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"15","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":323,"pos_y":237}}}}}

This example will copy the name of the linked property to the FirstName of the person. The same Copy value of field can be used. Via the referencefield the property can be fetched and with the . (dot) notation the field of that property can be read.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"15":{"id":15,"name":"Start of flow","data":{"basebo":"Person","undefined":"Person"},"class":"start","html":"","typenode":false,"inputs":{},"outputs":{"output_1":{"connections":[{"node":"16","output":"input_1"}]}},"pos_x":26,"pos_y":199},"16":{"id":16,"name":"Copy value of field","data":{"dataobject":"Target","targetdataobject":"Target","elementname":"PropertyRef.Name","targetelementname":"FirstName","sourcenotempty":"true","sourcechanged":"false"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.CopyElement","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"15","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":374,"pos_y":239}}}}}

Construct email address

This example will copy construct the email address based on the FirstName and LastName and saves it to the email field.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"15":{"id":15,"name":"Start of flow","data":{"basebo":"Person","undefined":"Person"},"class":"start","html":"","typenode":false,"inputs":{},"outputs":{"output_1":{"connections":[{"node":"22","output":"input_1"},{"node":"23","output":"input_1"}]}},"pos_x":20,"pos_y":191},"22":{"id":22,"name":"Get field value (Static)","data":{"dataobject":"Target","elementname":"FirstName"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"15","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"24","output":"input_1"}]}},"pos_x":382,"pos_y":235},"23":{"id":23,"name":"Get field value (Static)","data":{"dataobject":"Target","elementname":"LastName"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"15","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"24","output":"input_1"}]}},"pos_x":384,"pos_y":479},"24":{"id":24,"name":"Format string","data":{"message":"%s.%s@planonsoftware.com"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.string.Format","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"22","input":"output_1"},{"node":"23","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"25","output":"input_1"}]}},"pos_x":709,"pos_y":307},"25":{"id":25,"name":"Set field value","data":{"dataobject":"Target","elementname":"Email"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElement","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"24","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":1029,"pos_y":318}}}}}

Check postalcode

This example will check if the provided postalcode is valid on a property.

Steps:

  • Get PostalCode field value
  • Match value with regular expression ^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[A-Za-z]{2}$. When not matched output 2 will be executed.
  • Show an error Postal code is not valid. For dutch users a dutch message “Postcode is niet juist” will be showed.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"15":{"id":15,"name":"Start of flow","data":{"basebo":"Property","undefined":"Property"},"class":"start","html":"","typenode":false,"inputs":{},"outputs":{"output_1":{"connections":[{"node":"29","output":"input_1"}]}},"pos_x":20,"pos_y":191},"28":{"id":28,"name":"MatchRegEx (ITE)","data":{"regex":"^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[A-Za-z]{2}$"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.comparison.MatchRegExIfThenElse","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"29","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]},"output_2":{"connections":[{"node":"30","output":"input_1"}]}},"pos_x":627,"pos_y":323},"29":{"id":29,"name":"Get field value (Static)","data":{"dataobject":"Target","elementname":"PostalCode"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"15","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"28","output":"input_1"}]}},"pos_x":323,"pos_y":339},"30":{"id":30,"name":"Show error","data":{"errorid":"5929","message":"Postal code is not valid.","langnld":"Postcode is niet juist"},"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.notification.ErrorMessage","html":"","typenode":false,"inputs":{"input_1":{"connections":[{"node":"28","input":"output_2"}]}},"outputs":{},"pos_x":957,"pos_y":330}}}}}

Create event based notification

This example will check create a new eventbased notification task once a UsrOrder has been changed.

Steps:

  • Create Task BusinessObject
  • NotificationRef -> NotificationEventBasedDefinition is searched based on the provided code.
  • BODefinitionRef -> Is filled with the BOtype of the changing UsrOrder.
  • BORef -> Is filled with the syscode of the changing UsrOrder
  • PlannedDateTime -> is set with the current systemtime.
  • Task BO is saved.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"132":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"133"}]}},"pos_y":329,"pos_x":32,"data":{"checksum":"5f834785b455fe9d3377e7c38b759d270b3741e108eb1b2655777ad3d98a589c","basebo":"UsrOrder","undefined":"UsrOrder"},"inputs":{},"name":"Start of flow","html":"","id":132,"class":"start"},"133":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"135"},{"output":"input_1","node":"144"},{"output":"input_1","node":"145"},{"node":"146","output":"input_1"},{"node":"141","output":"input_1"}]}},"pos_y":488.77777777777777,"pos_x":350,"data":{"elementname":"Task"},"inputs":{"input_1":{"connections":[{"node":"132","input":"output_1"}]}},"name":"Create businessobject","html":"","id":133,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.Create"},"134":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"136"}]}},"pos_y":102,"pos_x":1023,"data":{"elementname":"Syscode","dataobject":"@NotificationEventBasedDefinition"},"inputs":{"input_1":{"connections":[{"node":"135","input":"output_1"}]}},"name":"Get field value (Static)","html":"","id":134,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic"},"135":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"134"}]}},"pos_y":93,"pos_x":732,"data":{"elementname":"NotificationEventBasedDefinition","lookupvalue":"EM001"},"inputs":{"input_1":{"connections":[{"node":"133","input":"output_1"}]}},"name":"Find by lookup (Static)","html":"","id":135,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.FindByLookupStatic"},"136":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":67,"pos_x":1319,"data":{"elementname":"NotificationRef","dataobject":"@Task"},"inputs":{"input_1":{"connections":[{"node":"134","input":"output_1"}]}},"name":"Set field value","html":"","id":136,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElement"},"138":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"139"}]}},"pos_y":421,"pos_x":1028,"data":{"elementname":"Syscode","dataobject":"RefBODefinitionUserDefined"},"inputs":{"input_1":{"connections":[{"node":"146","input":"output_1"}]}},"name":"Get field value (Static)","html":"","id":138,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic"},"139":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":394,"pos_x":1319,"data":{"elementname":"BODefinitionRef","dataobject":"@Task"},"inputs":{"input_1":{"connections":[{"node":"138","input":"output_1"}]}},"name":"Set field value","html":"","id":139,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElement"},"141":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"142"}]}},"pos_y":785,"pos_x":740,"data":{"elementname":"Syscode","dataobject":"Target"},"inputs":{"input_1":{"connections":[{"node":"133","input":"output_1"}]}},"name":"Get field value (Static)","html":"","id":141,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic"},"142":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":740,"pos_x":1040,"data":{"elementname":"BORef","dataobject":"@Task"},"inputs":{"input_1":{"connections":[{"node":"141","input":"output_1"}]}},"name":"Set field value","html":"","id":142,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElement"},"143":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":1042.5714285714287,"pos_x":1041,"data":{"elementname":"PlannedDateTime","dataobject":"@Task"},"inputs":{"input_1":{"connections":[{"node":"144","input":"output_1"}]}},"name":"Set field value","html":"","id":143,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElement"},"144":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"143"}]}},"pos_y":1058,"pos_x":747,"data":{},"inputs":{"input_1":{"connections":[{"node":"133","input":"output_1"}]}},"name":"System date","html":"","id":144,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.date.SystemDate"},"145":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":1238,"pos_x":747,"data":{"dataobject":"@Task"},"inputs":{"input_1":{"connections":[{"node":"133","input":"output_1"}]}},"name":"Save data","html":"","id":145,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.Save"},"146":{"typenode":false,"outputs":{"output_2":{"connections":[]},"output_1":{"connections":[{"output":"input_1","node":"138"}]}},"pos_y":360,"pos_x":732,"data":{"elementname":"RefBODefinitionUserDefined","dataobject":"Target"},"inputs":{"input_1":{"connections":[{"node":"133","input":"output_1"}]}},"name":"Goto element (Static)","html":"","id":146,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GoToElementStatic"}}}}}