Events Menu
Compose Enterprise is going through a design update. The illustrations on this page might be of the old design, but the information is up to date. Thank you for your patience during this update!
All question elements in the Form Builder except the file upload element has an Events button in the Builder tab of the element Properties panel. Clicking that button launches the Events menu. Here you may add scripts, define generic service calls and set when the calls and scripts should be executed.
The Events menu is split in two panels – the Events Configuration (left) and the Action Configuration (right).
Events Configuration | ||
---|---|---|
Move up | If you have more than one event, you can change the sequence of them by selecting one and click move up to move it up in the list. | |
Move down | If you have more than one event, you can change the sequence of them by selecting one and click move down to move it down in the list. | |
New event | Creates a new event. Event properties needs to be set for the execution of the action. An empty event will cause an error when trying to save your form. | |
Delete event | Created events can be deleted by selecting the event and clicking the Delete event button. | |
| Event | The event can be either After answer is completed or When filling out answer. Respectively, this means your script or service will be executed after the answer is completed or continually as the answer is being filled out. |
| Action | Select between three* actions:
|
* As generic services have replaced all functionality provided by CNG services, this action is outdated. See CNG services (form population)archived for more information.
Execute script
Action Configuration - Execute script | |
---|---|
Code mirror | A Groovy script triggered by the event can be entered in the code mirror. Reference other question elements by question ID (Q1, Q2 etc.), and use the question properties along with the Groovy library to customize your scripts. Most Groovy methods are accessible in the code mirror. For a full method overview, check out the Scripting in Compose and Advanced form scripting documentation. |
Open | Opens a larger code mirror for a more convenient sized work surface. |
To see examples of the Execute script action, see the user guide Events / Calculator.
Call generic service
For a full guide on configuring generic services in the Events menu, check out the Generic services (form and workflow population) user guide.
Action Configuration - Call generic service | |
---|---|
Generic service | Displays the connected generic service after clicking Browse and selecting one. |
Browse / Clear | Browse to select a generic service from the repository and Clear to remove a selected one. |
Version | Select a version of the generic service for the call in the dropdown of versions. |
Update to highest minor version automatically | When checked the highest minor version of the generic service version selected in the Version dropdown will be used. Minor versions are 1.1, 1.2, 1.3 etc. while major versions are 1.0, 2.0, 3.0 etc. I.e. if you create a new minor version of the generic service, this version is automatically updated. Aka. the version does not need to be updated in the Events menu. |
Map request variables | If the connected generic service has request variables, map them to static values or question answers in the Variables menu behind this button. |
Map response variables | If the connected generic service has response variables, map them to static values or question answers in the Variables menu behind this button. |
Show errors to the user | If the generic service call fails, an error page or error message will be displayed to the end user of the service. |
To see examples of the Call generic service action, see this user guide Generic services (form and workflow population) or click here to check out a Compose tutorial. The tutorial takes you through setting up a generic service and connecting it in a form in the Events menu (English subtitles available).