Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

Defining the Event Logic

The step Event Logic will allow you to watch certain events during the configuration at run-time, and to take action when these events occur.

For instance, the event onComplete can be used to trigger the action apply breakdown (which generates the sales breakdown lines, pricing information, etc.) when the configuration is completed.

It is important to understand that the events are triggered once the constraint propagation is finished and not immediately after a user action.

Warning: The events and their belonging actions are executed after the constraint propagation, in sequence. Meaning, whenever a user answers a question:
  • The constraint propagation starts, and the CPQ engine will automatically broadcast that answer to all BRC that have an alias pointing to that form property. The event is triggered, and the actions are triggered in sequence. If an action triggers a constraint propagation cycle, the next action will only start when the propagation is finished.

In this step, you will define actions and their related triggering events. The goal is to automate some actions at run-time:

  • to guide the end-user,
  • to facilitate/automate navigation during the configuration of the product
  • to launch internal processes or calculations.
  • Etc..
    information: The goal of event logic is to automate user actions or to trigger the calculation of generative processes.

A typical example is to generate the sales breakdown and to calculate the associated pricing elements once the configuration is considered as completed.

In order to define events, 2 steps have to be accomplished:

  • The first step concerns the identification of the object in the configuration structure that will “contain” certain events. It is important to understand that in the Configurator, the end-user will navigate from one object to another. The involved objects are obviously Configuration Processes, Forms and Form Properties.
  • The second step concerns the definition of the exact element that the container has to listen to as well as the definition of the actions that have to be executed.

Identify events

The first step concerns the identification of the events, as well as their containers. In order to declare a certain event for a specific object, proceed as follows:

How-To:

  • [In the explorer]
    • Select the object for which you want to watch certain events.
  • [In the explorer]
    • Using its icon, drag and drop this object on the corresponding table section (Configuration Process, Form, Form Properties) table.
  • [In the event table]
    • Check the box corresponding to the Event Type you want to associate to the container (see table below to have details on the possible Event Types).
  • [In the menu toolbar]
    • Execute the Save function
      • A new box corresponding to the association Container-EventType is created in the Map section of the working area

The description of the event types is given by the following table:

EVENT TYPE DESCRIPTION
On Change The “onChange” event triggers when the value of the CPE passed as a parameter changes. This CPE has to be a leaf CPE, such as CPE…FP/myFP.value (node CPE such as CPE….FO/myForm cannot be watched by the onChange event). Source Value and Destination values can be specified to set conditions for the event to be triggered. Three pre-defined values can be used via combobox: EMPTY_VALUE: means that there should not be any value NOT_EMPTY_VALUE: means that there should be a value EITHER_WAY: means that it will trigger in either way
EVENT TYPE DESCRIPTION
On Complete The “onComplete” event triggers when the state of the object designated by the CPE becomes “completed”.
On Error The “onError” event triggers when the state of the object designated by the CPE becomes “failed”.
On Activate The “onActivate” event triggers when the object designated by the CPE is opened by the configuration user interface.
On Delete The “onDelete” event triggers when the object designated by the CPE is deleted. This event can only be used on Nested objects.
On Reload The “onReload” event triggers when the configuration is loaded or reloaded. This event can only be used on root Configuration Processes.
On Insert The “onInsert” event triggers when a new instance is added to the object designated by the CPE. This event can only be used on Nested objects (Configuration Processes and forms).
On Paste The “onPaste” event triggers when the object designated by the CPE is pasted. This event can only be used on Nested objects.
On Exists The “onExists” event triggers when the state “exists” of the object designated by the CPE issues “true”.
On After Save The “onAfterSave” event triggers once the object designated by the CPE is saved. The save is normally triggered by the configuration user interface. This event can only be used on root Configuration Processes.
On Before Save The “onBeforeSave” event triggers just before the object designated by the CPE is saved. The save is normally triggered by the configuration user interface. This event can only be used on root Configuration Processes.

In order to remove all events of a certain type for a certain object or object class, proceed as follows:

How-To:

  • [In the event table]
    • Select the line for which you want to remove the events of a certain type
  • [In the event table]
    • For that line, empty the checkbox corresponding to the event type you want to remove
  • [In the menu toolbar]
    • Execute the Save function  The event map is updated and the associated “box” is removed.

In order to remove a specific event for a certain object or object class, proceed as follows:

How-To:

  • [In the event map]
    • Click on the box corresponding to the object/event
      • The event details are shown
  • [In the event toolbar]
    • Execute the Delete function after having selected the event to be removed
  • [In the menu toolbar]
    • Execute the Save function
      • If only one event was defined, the event logic matrix is shown again

Specify the actions

For each object for which a certain event type has been identified, one or multiple events can be created and for each event, one or multiple actions can be associated.

In order to specify the content for an event along with its actions, proceed as follows:

How-To:

  • [In the event map]
    • Click on the box corresponding to the object/event
      • The event details are shown
  • [In the event section]

    Update the event properties:

    • Event name: enter a unique name for the event
    • Event container: read-only, generated by the previous step
      • Event CPE: this is the event pattern you want to listen to. This event can be a specialization of the CPE mentioned in the event container.
  • Define the actions:
    • For each action to be added, a line needs to be inserted using the insert line function
    • Depending on the action that you added, you may have to specify some parameters
  • [In the menu toolbar]
    • Execute the Save function
      • The event map is updated.

In order to add a subsequent event definition for an already existing event type/object in the event map, proceed as follows:

How-To:

  • [In the event map]
    • Click on the box corresponding to the object/event
      The event details are shown:

      [In the Explorer toolbar]

      Execute the Add event function

      [In the popup]

      Enter the event name and click on “OK

      Proceed by defining the new event

The event CPE, as mentioned before, is the eventual CPE that the CPQ engine will listen to. The following CPE formats are supported:

  • Absolute CPE, like CPE.rootCP.wks/FO/myForm.FP/myFP.value
  • CPE using wildcards, like CPE.wks/CP/myCP.FO/*.FP/fp1.value
    Warning: In the event definition, CPE containing relative keywords (such as currentCP, currentForm or currentFP) or the nearest keyword cannot be used because they don’t make any sense (the event logic is always executed in the context of the root CP). The keyword rootCP however is supported.

    Moreover, instances can be targeted specifically using [1], [2] or [last]. The [current] instance is not supported.

    Warning: When the configuration engine is working on a certain CPE, it will basically look in the event definition table to all event CPE. As the event CPE is actually an event pattern (not necessarily a complete and valid CPE), the engine will actually verify if the event pattern matches the CPE it is working on.

As seen before, certain event types will typically target a complete object, and others will target an attribute. Currently, only the onChange event will target a specific attribute; all other events will target an object (a Configuration Process, a form or a form property).

Warning: Avoid generic events like for instance “onChange(CPE.FP/.value). This kind of events

will be triggered throughout the configuration and will potentially have a severe impact on performance.

In order to better understand this, let’s have a look at the following example:

Suppose that you want to execute an action whenever a form is successfully completed. In order to do this, you could use the following syntax:

onComplete(CPE./FO/)

Indeed, in this case, when the engine reaches the following form: CPE.rootCP.FO/myForm

It will clearly state that the event CPE pattern matches the current CPE. However, when the user completes the form property CPE.rootCP.FO/anotherForm.FP/aFormProperty

The engine will also see that this CPE matches the pattern used by the event CPE.

The following actions can be defined:

ACTION DESCRIPTION PARAMETER/VALUE
Activate The “Activate” action allows the configuration user interface to automatically redirect to the object designated by the CPE, and to open it. Parameter: CPE Value: an absolute or relative CPE corresponding to the object that you want to activate
Apply When the “apply” action is triggered, the engine will (re)calculated the generative process specified by its parameter: Note: As of version 7.1 SP4, the values “Pricing Method”, “Custom Method” and “Sales Information” have been deprecated. Parameter: Method Type Value: Breakdown
ACTION DESCRIPTION PARAMETER/VALUE
Add to cart Sends the result of the configuration to the quote (only applicable if integrated in Quote. Parameter: GoTo Value: UI page the user will be redirected to (e.g. cartPage, quote, etc..) Cf. UI Customization Guide
Auto Assign Default Values The “Assign Default Value” action allows completing the part of the Configuration Process specified by the CPE. This action only completes form properties for which a default value is given. Parameter: CPE Value: an absolute or relative CPE corresponding to the object that has to be completed. If you want to assign the default values in the whole CP you can use CPE.rootCP.
Auto Assign Values The “Assign Value” action allows completing the part of the Configuration Process specified by the CPE. This action completes form properties by automatically selecting the first value of the FP domain. Parameter: CPE Value: an absolute or relative CPE corresponding to the object that has to be completed. If you want to assign the values in the whole CP you can use CPE.rootCP.
Collapse The “Collapse” action allows the configuration user interface to automatically collapse the explorer. Parameter: CPE Value: an absolute or relative CPE
Copy The “Copy” action allows copying the object designated by the CPE in the clipboard. This action is only available on instances of nested elements Parameter: CPE Value: the absolute or relative CPE corresponding to the instance to be copied
ACTION DESCRIPTION PARAMETER/VALUE
Cut The “Cut” action allows to cut the object designated by the CPE and to put it in the clipboard. This action is only available on instances of nested elements. Parameter: CPE Value: an absolute or relative CPE corresponding to the instance to be cut
Delete The “Delete” action allows deleting the object designated by the CPE. This action is only available on instances of nested elements. Parameter: CPE Value: an absolute or relative CPE corresponding to the instance to be deleted
DisplayBox The “DisplayBox” action allows opening up a flyer on the configuration user interface designated by the name given as a parameter. (Used in particular for informationFlyers when the message persistence is active) Parameter: Box Name Value: Name of the displayed box
Execute BRC The “Execute BRC” action allows the execution of a procedural BRC. This action only applies to “Macrobased BRC’s”, which do not put a constraint in the system. Parameter: BRC Name Value: Name of the BRC 2nd Parameter: BRC Parameters Value: absolute or relative CPE corresponding to the object to which the BRC is attached
ACTION DESCRIPTION PARAMETER/VALUE
Export XML The “ExportXML” action exports the root Configuration Process to the XML file given as a parameter. Parameter: Destination File Value: Path of the destination file. Currently the model is exported to the file given as a parameter when launching the configuration.
HideBox The “HideBox” action allows closing a flyer on the configuration user interface designated by the name given as a parameter. Parameter: Box Name Value: Name of the box to be closed
Import XML The “ImportXML” action starts a new configuration session based on the XML file given as a parameter Parameter: Source File Value: Path of the source file
Insert The “Insert” action allows inserting a new instance before or after the object designated by the CPE. This action is only available on instances of nested elements. Parameter: Insert Order Value: Before or After 2nd Parameter: CPE Value: the absolute or relative CPE pointing to the instance
ACTION DESCRIPTION PARAMETER/VALUE
Parameter: Move Direction Value: Down or Up
Move The “Move” action allows moving up or down the instance designated by the CPE. This action is only available on instances of nested elements. 2nd Parameter: CPE Value: the absolute or relative CPE pointing to the instance
Paste The “Paste” action allows pasting the object previously cut or copied in the clipboard onto the object designated by the CPE. This action is only available on instances of nested elements. Parameter: CPE Value: the absolute or relative CPE pointing to the instance
Reset The “Reset” action allows resetting the value of the object designated by the CPE. This action has as a consequence that the value attributed to the object is taken out. If you reset an object that is displayed you may have to refresh the screen to view the modification. Parameter: CPE Value: the absolute or relative CPE pointing to the object to be reset
This action is only available on Configuration Processes, forms and form properties.
ACTION DESCRIPTION PARAMETER/VALUE
The “SendCustomEvent” action allows triggering a “onCustomEvent” designated by its name as an action from within another event.
This event MustExist in the Event Logic Table and the name must be the same as given as parameter in the send custom event action.
Send Custom Event If more than one event with the same name exists, they will all be launched (but they are not ordered). Parameter: Custom Event Value: Name of the Custom Event
You can also launch a SendCustomEvent triggered by an action of the User Interface. You have to modify the configuratorUI.xml file by adding an action SEND_CUSTOM_EVENT in an actionBox: <action actionName="SEND_CUSTOM_EVENT (eventName=myEventName)" …/>
ACTION DESCRIPTION PARAMETER/VALUE
The “Set” action allows setting the value of the object designated by the CPE. This action is only available on form properties. The field needs xml to describe the value to set.
Example: <?xml version='1.0' encoding='UTF-8'?> <conf:ConfigurationTree xmlns:conf="com.cameleon.business .xml.configurationTree-7.1.0.0" xmlns:cam="com.cameleon xmlns:cam="com.cameleon .business.xml.settingsTree-7.1.0.0">
<conf:ConfigurableProduct wks="AC" name="EventCP" cpe="CPE.AC/CP/EventCP">
<conf:Form wks="AC" name="FormEvent1" cpe="CPE.AC/CP/EventCP.AC /FO/FormEvent1">
Set <conf:FormProperty wks="AC" name="fpActionSet" cpe="CPE.AC/CP/EventCP.AC /FO/FormEvent1.FP/fpActionSet"> Parameter: Value Value: XML describing the value to set.
<conf:SystemProperties type="Date" valuationType="Single" />
<conf:SingleValuation isCommentUserChoice="true" isQtyUserChoice="true" isValueUserChoice="true">
<conf:Value> <conf:dateValue
1970-01-01T01:02:25.000+01:00
</conf:dateValue> </conf:Value> </congf:SingleValuation> </conf:FormProperty> </conf:Form> </conf:ConfigurableProduct> </conf:ConfigurableTree>
information: As of version 7.1 SP4, the calculation of the generative process happens in 2 phases:

The initial calculation of generative processes is triggered by the apply breakdown action. This calculation will calculate all generative processes, and will also gather all sales dialog CPE (form properties etc.) which are used as an input for the generative processes.

Subsequently, the generative processes will be re-triggered each time one of these gathered sales dialog CPE changes. This means that the calculation of generative processes will only be triggered by form properties (or other sales dialog CPE) which explicitly have an impact on sales breakdown lines, pricing, etc. These subsequent calculations will be triggered after the constraint engine propagation, but before any other event logic execution.

Warning: Any subsequent apply breakdown action (beyond the initial calculation) will also recalculate the generative processes. For performance reasons, these subsequent actions should be avoided in general, and only be used in the case that the generative processes are not being triggered by themselves.

How to remove an action

How-To:

  • [Via the ‘Event Map’ section]
    • Click on the box corresponding to the association EventType-Container you want to manipulate. You are redirected to a new working area where you can find the associated actions.
  • [Via the ‘Action Parameters’ table]
    • Select the line corresponding to the action you want to delete.
  • [Via the Table Toolbar]
    • Click on ‘Delete Line’
  • Save

Filtering Events

If many Events are defined in your CP, it may be hard to locate one in particular in an unfiltered list. It is possible to filter the event list at the bottom of the screen.

By selecting CPs, Forms, or Form Properties, it will narrow down the list of events to those belonging to your selection.

All events are displayed when no element is selected.