Skip to main content
The Execute EDM operations business rule allows you to perform a number of operations on SQL database entities created using the FlowForma Entity Data Manager. You’ll find it in the Data Integration section of the Add rules menu in the Flow designer. Execute EDM operations rule in the Flow designer

Title

The first part of the business rule lets you define a title for your rule and select the event on which it operates. The default title is the standard FlowForma rule name; change it by deleting the text and entering your own. In the event field you determine when the rule is executed. For a flow this can occur when the form is loaded, started, or completed. For a step this can occur when the step is started, saved, or completed. For questions it can occur when the question is updated.

Rule condition(s)

The second part of the business rule lets you set conditions. These are not required, but if entered they control when the rule is executed in relation to other items in the form.

Rule action

This rule operates by mapping questions in a FlowForma form to entities in the Entity Data Manager SQL database.
  • Operation: the rule allows you to perform the following operations:
    • Create new entity item
    • Add existing entity item
    • Update entity item
    • Get entity item
    • Delete entity item
    Select the operation you require using the radio buttons.
  • Entity sets: this dropdown shows all the entities present in the Entity Data Manager database. The operation you select will be performed on this entity.
  • Input mappings: this section allows you to map questions on FlowForma forms to items in the entity in the Entity Data Manager database.
  • Output mappings: when the rule action has completed, the id of the affected item in the database is returned. To display this value on a form, map the EDM entity ID to a form question.
  • Stop execution: if stop execution is enabled and this rule is executed, no other rules are executed.
  • Enabled: rules aren’t saved to a list like questions and steps are, so if you want to stop a rule executing without deleting it, toggle this option to enable or disable the rule.
  • Enable audit: if checked, a record is added to the audit trail when this rule is executed. This option is available when the Compliance feature pack is activated.

Create new entity item

This rule action creates a new row in the EDM database, in the dbo.Entity_EntityName table. The dbo.FormEntity_EntityName and dbo.Sys_Forms tables are also updated with the Id of the entity created. Create new entity item rule configuration When you select the Create new entity item radio button, the mapping sections required to create a new entity are displayed.
  1. From the Entity sets drop-down, select the Entity set (table) where you want the item created in the EDM database.
  2. The Input mappings section is now displayed. You can now map the FlowForma form questions to the EDM database.
  3. If you want the id of the item created in the database displayed on the form, map the EDM entity id to a form question.

Example

Create a business rule, map the form questions to an EDM entity, then save the rule and the flow. Business rule with form questions mapped to an EDM entity Create a new form, enter data, and submit the step. New form with data entered The dbo.Entity_EntityName table is updated in the database. dbo.Entity_EntityName table updated in SQL The entity id is output to the FlowForma form. Entity id displayed on the FlowForma form

Add existing entity item

In your EDM database you may have created entities that you want to use in FlowForma forms but not update from them. For example, you may have a Customers entity. When forms are generated, you want to select an existing customer rather than create a new one. To achieve this, use the Add existing entity item operation. Add existing entity item rule configuration In the rule, select the Add existing entity item radio button. Select the entity set that contains the item you want to add. You then need to select the unique Entity Id of the specific item you require. The easiest way to do this is to use an EDM lookup question to find the required Id. When the rule executes, the dbo.Sys_Forms entity is updated, and dbo.FormEntity_EntityName is updated with the Id of the entity selected in the rule. dbo.Entity_EntityName is NOT updated, as an existing item has been used.

Update entity item

You may want to update an entity in the EDM database. To do this, select Update entity item in the rule editor. Update entity item rule configuration You now need to select the entity that contains the item you want to update from the Entity sets drop-down. After selecting the entity, select the question that contains the unique entity Id of the specific item you want to update. Now you can map FlowForma form questions to entity fields to update the selected item. You can update a single item or multiple items depending on your needs. In the EDM database, the dbo.Entity_EntityName table is updated, but none of the other tables are updated.
If you leave a FlowForma form question blank, the entity in the EDM database will be updated as empty. Anything previously entered in this field will be overwritten.

Get entity item

You may want to display items from EDM tables on a FlowForma form. To do this, use the Get entity item business rule. Get entity item rule configuration Select the Get entity item radio button. You now need to select the entity that contains the item you want to retrieve (get) from the Entity sets drop-down. After selecting the entity, select the question that contains the unique entity Id of the specific item you require. This is usually done using an EDM lookup question. Now you can map the FlowForma form questions you want to display the data in to entity fields in the EDM database. When the rule executes, data is retrieved from the database and the form questions are populated. None of the database tables are changed, as no fields have been changed.

Delete entity item

You may want to delete an item from an EDM entity. To do this, use the Delete entity item rule. Delete entity item rule configuration Select the Delete entity item radio button in the rule editor. You now need to select the entity that contains the item you want to delete from the Entity sets drop-down. After selecting the entity, select the question that contains the unique entity Id of the specific entity item you require. This is usually done using an EDM lookup question. When the rule executes, the entity row with the Id selected above is removed from the EDM database entity.

Business rules and updating entities

If you update entities through the Entity Data Manager, adding or removing fields from entities, or deleting entities completely, business rules will not be updated automatically. You will need to edit any rules affected by these changes.