Skip to main content

How to run and test a function used in a business rule

As part of building the Business Rule and all of its components such as Functions, Maths and Table Lookups a user can "run" and "test" if the logic they have built is working properly given a specific

Updated over 2 weeks ago

As part of building the Business Rule and all of its components such as Functions, Maths and Table Lookups a user can "run" and "test" if the logic they have built is working properly given a specific provided context.

When any of the Data Sources components (Table Lookup, Math or Function) is selected, a pop-up window is displayed giving the possibility of performing one out of four actions:

  • Create New - to create a new record

  • Copy Existing - to create a new record from copy an existing one

  • Select Existing - to reuse a previously created record

  • Run Existing - to execute the source, and given an entered context - Assignment ID, Cost Estimate ID or Cost Estimate Line Item ID - retrieve the result

An existing function can be tested by selecting Run Existing. This is may be done prior to using the function or creating a copy of an existing function.

Function Selector - Run Existing

After selecting run existing, a pop-up window appears with the list of existing functions configured. Select the existing function by clicking

Run Button

Funtion - Run Existing.png

Alternatively, functions can be run and tested by clicking

run button

or

save & run button

. Click

run button

to test the component without saving it. Click

save & run button

to test and save changes to the component.

Funtion - Save and Run.png

When either

Run Button

or

save & run button

is clicked, the Context Selector pop up window appears.

Context Selector - Search.png

Provide the appropriate context where the function should run in the search context box. This can be either an Assignment ID, a Cost Estimate ID or a Cost Estimate Line Item ID. Click

Search button

. The Context Selector displays all the matched records based on the value entered in the Search Context field. Click on the

Rocket icon

to select a record to run the business logic against. Once the context is selected, click

Run button

for the function to be tested.

Context Selector.png

When the logic is executed, the final result is displayed to the user. To run and test the logic on a different Assignment ID, Cost Estimate ID or a Cost Estimate Line Item ID, click

Change Context button buttonwidth=

.

Note, that the running and testing of the function, only provides the output and in the Execution result field and does not display details about what the start and end dates used to arrive at the value 1067.

Did this answer your question?