Flowcharts’ Calls

Release date: 2021-06-12

Possibility to call a Flowchart from another Flowchart

 New operator Call Service allows calling a flowchart from the other flowchart:

Select Service from the dropdown and provide Service Parameters with data.  The flowchart implementing this service will be called and provide the result which can be used further in this flowchart.

Prior to calling the Service, please perform the following steps:

  1. LB Services Extension must be deployed on Sugar Instance. Find and download here LB Services Extension version that corresponds to your Sugar version.
  2. Service must be registered in Sugar – it must be a record in LB Service module with specified System Name and service Arguments.
  3. Flowchart that implements Service must be deployed.

Such a flowchart starts with On Service Call and describes what should happen when Service is called. When a result is expected (data in result port in Call Service operator), this result must be set with operator Set Service Result in the flowchart that implements Service:

Example of usage

Let’s say there are a bunch of flowcharts with the same steps to create a Task. Instead of performing the same steps in each flowchart, it is possible to create the Service and then re-use it.

  1. Register Service in Sugar.

 For this, just create a record in LB Services module and provide arguments that are needed to be filled to create Task:

N.B. Each time you add a new Service into Sugar it is needed to update the Metadata in the Logic Builder to work with the newly added Service.

  1. Create a Flowchart starting from On Service Call to create a Task using parameters that will be input in the Service. In a result input the Task ID.

  1. Deploy the flowchart into Sugar. Now you can use created Service in other flowcharts, e.g when Case with Type Product is added:

Also, it is possible to link the Task to other entities using result output port from the Call Service:

New Validation Possibilities

Operator Throw Exception allows addressing the challenges of data validation. For example, when data comes through API to Sugar from an external system – prior to applying changes or saving a record you could implement additional rules, and return an error when rules are violated. 

Throw Exception result is also seen in interface to users.

N.B. For validation rules, use error code 422

Example of usage

Let’s say that Quotes with “Discount Amount” more than 20% must be approved by Manager. To implement this rule, a Quote must not be moved forward prior to the approval either by a user or by API request.

 So the flowchart which implements all sets of checks ends with Throw Exception when conditions aren’t met:

 As a result, when criteria of the rule is violated, a user sees the following error in the interface:

 External Clients get the following error in the API response:

Possibility to round numbers

Operator Round allows rounding a value to specified precision (number of digits after the decimal point):

Precision:

  • If the precision is positive, a value is rounded to defined in precision significant digits after the decimal point.
  • If the precision is negative, a value is rounded to defined in precision significant digits before the decimal point (e.g. for a precision of -1 value is rounded to tens, for a precision of -2 to hundreds, etc.)

Round Type:

  • Round Half Up Rounds a value away from zero when it is half way there, making 1.5 into 2 and -1.5 into -2.
  • Round Half Down Rounds a value towards zero when it is half way there, making 1.5 into 1 and -1.5 into -1.
  • Round Half Even Rounds a value towards the nearest even value when it is half way there, making both 1.5 and 2.5 into 2.
  • Round Half Odd Rounds a value towards the nearest odd value when it is half way there, making 1.5 into 1 and 2.5 into 3.
  • Round Up Rounds a value away from zero, making 1.5 into 2
  • Round Down Rounds a value towards zero, making 1.5 into 1

Sugar 11.0.x Compatibility

Packages generated from Logic Builder are fully compatible with Sugar 11.0.x (Q2 2021 release).

Click to rate this post!
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published. Required fields are marked *