LB SugarBPM Extension

Logic Builder Extension for SugarBPM allows calling a flowchart from Process Definition and getting back a result from a flowchart to update a value in a field or evaluate in a Gateway.

LB Extension for SugarBPM empowers SugarBPM with Logic Builder with the following possibilities of:

  • calling an external system from SugarBPM
  • sending Emails with PDF attachments
  • working with various unrelated records within Sugar

LB Services Extension is required to use LB Extension for SugarBPM

Once LB Extension for SugarBPM is successfully deployed, please clean the browser cache to see newly added Actions.

LB Extension for SugarBPM adds two new Actions:

LB: Service Call allows calling a flowchart from Process Definition, passing parameters from Process Definition to a flowchart, and getting parameters back from a flowchart to Process Definition to update values in fields and/or further evaluation in Gateways.

LB: Change field works in the same way as the standard Action Change Field, but the value for a field can be selected from a previously called flowchart(s).

To use Flowchart in Process Definition:

  1. Create a Service record in LB Services Module, specify input and output arguments.
  2. Configure and deploy a flowchart that will be called from Process Definition.
  3. Configure Process Definition to call the flowchart, use results from the flowchart in Exclusive and Inclusive Gateways for evaluation, and use values from the flowchart to update values in the record’s fields.

Create a Flowchart that will be called from SugarBPM

The start operator for the flowchart that can be called from Process Definition is On Service Call. So, to create such flowchart, create a Service in LB Service Module in Sugar first.

Please follow LB Services Documentation to find out more about LB Services Extension.

Please note that arguments in the Service do not have input or output direction. It is up to you which arguments’ values you are going to input in a Process Definition and then use in the flowchart, or which are going to be set in the flowchart and then are used to set values with LB: Service Call or LB: Change Field Actions.

If a value from the flowchart is going to be a part of the evaluation criteria in Exclusive or Inclusive Gateway, create an argument return for it. The value of this reserved argument can be evaluated in Gateways.

Let’s say that we need to create a flowchart that counts the number of Leads in work assigned to a Sales Rep. In the example below, we are using the argument user_id which value is going to be set in Process Definition and the argument return which is going to be set in the flowchart and then evaluated in Gateway.

The flowchart that implements mentioned above may be like this:

Please keep in mind the following notes when configuring the flowchart that will be called from Process Definition:

  • Dropdown/multiselect field value usage

If you pass dropdown/multiselect from Process Definition to the flowchart, it will pass the Display Label of the value, not the Item Name (key). Consider this when building evaluation criteria in the flowchart, for example, use Get Dropdown Display Label:

  • Checkbox field value usage

If you pass a checkbox value from Process Definition to a flowchart, it will pass the value Yes or No. Consider this when building evaluation criteria in the flowchart, for example, compare the value with String:

  • Target Module Record usage

Since the Target Module Record is processing by Running Process itself you should avoid:

  • Using Retrieve Entity to get the record or Get Entity Attributes to get field values. During SugarBPM process execution the record may be changed, while the flowchart gets the record as it was prior to any changes made by Process. Pass needed values from the record directly through the service arguments instead.
  • Applying any changes to the Target Module Record with Set Entity Attributes or Save Entity. Use LB: Service Call or LB: Change field elements to update the record.

Calling a flowchart from Process Definition

To call a flowchart add Action LB: Service Call to the Process Definition.

This action:

  • calls the flowchart
  • allows passing parameters from Process Definition to the flowchart
  • enables updating fields in target or related records with the result from the flowchart

Once Action is added to the Process Definition, it must be configured:

Service Name – select from the list of Services registered in the current Sugar.

Parameters – set values for the service arguments that must be passed to the flowchart.

As for the values for the parameters, it is possible to use:

  • a value from the Target Module Record fields

  • a value from the Services parameter that was previously called from this Process Definition
  • a manually entered value
  • Combination of all three options above

Module and Fields work in a similar way as in standard Action Change Field with the difference that the value of a field can be set with one of the argument’s values from the flowchart selected in Service Name. This means that if you calculate or define some value within the flowchart, which is called by this LB: Service Call Action, you can put the result of this calculation as a value for the field of Target Module Record or related as many-to-one to the Target Module Record.

Example of calling the flowchart from Process Definition

Let’s consider the following example:

When a user clicks Send Quote button, Sugar should send an email to the Billing Contact with PDF Quote attached.

Send Quote button is implemented using ActionButton type of field and once clicked, it sets a custom checkbox ‘Send Quote Email’. This in turn initiates the following Process:

Whenever the checkbox is true, Process Definition generates Doc via the element Doc Merge and waits 3 minutes so the document is generated by Sugar and linked to the Quote.

Then element LB: Service Call calls the flowchart that composes and sends the Email.

The following Service is registered in Sugar for this flowchart:

Billing Contact ID and Quote ID is going to be passed from Process Definition to the flowchart.

There are the following settings of LB: Service Call element in this Process:

Also in the very same element, we want to erase the value from the custom field ‘Send Quote Email’ so that this Process can run several times for the Quote:

Finally, the flowchart that implements email composing and sending may look like this:

Using results from a flowchart in Gateways

Results from a flowchart, e.g. calculation, can be used for evaluation in Exclusive and Inclusive Gateways.

A value that can be evaluated must be placed in the argument return in the flowchart through Set Service Parameters.

In the Gateway Settings in the Evaluations section, there is an option LB: Service Call Evaluation:

In the following settings, select a flowchart (that was called in this Process Definition) that sets a value in return argument and is needed to be evaluated and build a criterion:

Example of usage result from a flowchart in Process Definition

Let’s extend the standard Process ‘Route Lead and Create Follow-Up Task’ with an additional step that when there are more than 100 Leads on a Sales Rep, then Lead should be Routed by the Sales Manager.

  1. Create a record in LB Services first. Add argument ‘return’ which we are going to use in the Gateway:
  1. Then create a flowchart that counts the number of Leads for a particular user:

  1. Proceed to Process Definition ‘Route Lead and Create Follow-Up Task’ and add the element to call a flowchart, exclusive Gateway, and an alternative path:
  1. Apply settings for LB: Service Call Element to call a flowchart and pass Assigned User ID into flowchart:
  1. Finally configure Exclusive Gateway by setting the default path and an evaluation criterion:

Using results from a flowchart to set a value in a field

It is possible to set value in Target Module Record or related Record with LB: Service Call and LB: Change Field.

With LB: Service Call value for the field of Target Module Record or related to the Target Module Record as many-to-one can be set with the result from a flowchart right away after the flowchart was executed.

With LB: Change Field value for the field of Target Module Record or related to it (in the same way as for standard element Change Field) can be set with the result from a flowchart anywhere in the Process Definition.

As the value for the field in LB: Service Call and LB: Change Field you can:

  • use value of the argument from the flowchart (or flowcharts for LB: Change Field), that was(were) called in this Process Definition
  • manually enter the value

Please note that neither LB: Service Call nor LB: Change Field controls the correspondence between the field type and the type of the value being set.

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

Leave a Reply

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