...
If an entity does not have these components already generated, you can regenerate the entity, which will then generate these components. See the Regeneration at Entity section of the Entities Administration topic in the Aptify Administration Guide for information on how to regenerate an entity.
...
- When designing a process flow that operates on an sub-type entity using one of the CRUD components, you need to pass in the GEObject for the sub-type record's parent via the -Context Object to the sub-type component's step. You can do this in one of two ways:
- If an event from the parent record fires the process flow, you can specify the GEObject as an Input Property for the Process Flow. Then, pass in the parent record's GEObject as part of the Event Handler.
- If an event in an unrelated entity fires the process flow, use the top-level entity's Load component to load the desired record and then pass its GEObject into the Context Object (GEObject is an Output Property for the Load component). Once in the Context Object, you can specify the parent GEObject as an Input Property for the sub-type component's step.
- When designing a process flow that uses CRUD components, consider the frequency and impact of save operations, and try to minimize the number of save operations for best performance.
- For example, If a process flow creates a subtype record in a top-level record based on a change in that top-level record, use a before save event as the basis for the Event Handler. Then, within the sub-type component step, set the - SaveRecord input property to No for a deferred save. In this case, the toplevel record, with any applicable sub-type record changes, is saved after the process flow has executed.
- Continuing from the example above, consider the ramification of the following designs for a process flow that creates a new sub-type record when a new toplevel record is saved:
- Event: BeforeRecordCreated
Step SaveRecord Input Value: No
Result: Process Flow fires before record is saved and creates a sub-type record. The Save is deferred until after the process flow completes. There is one save operation and one Record History entry associated with this transaction. - Event: BeforeRecordCreated
Step SaveRecord Input Value: Yes
Result: Process Flow fires before record is saved and creates a sub-type record. The process flow attempts to save the sub-type record to a top-level record that doesn't exist yet, creating an invalid state and an error. - Event: AfterRecordCreated
Step SaveRecord Input Value: Yes
Result: Process Flow fires after record is saved and creates a sub-type record, followed by another save operation to save the sub-type record. This operation is successful but two save operations occur (and two Record History entries) when one would have sufficed. Also, if the designer used the AfterRecordUpdated event in place of AfterRecordCreated in this scenario, Aptify would enter an infinite loop since each sub-type save would fire the process flow, which would create another sub-type record, etc. - Event: AfterRecordCreated
Step SaveRecord Input Value: No
Result: Process Flow fires after record is saved and creates a sub-type record. At some point, another save would be required to save the sub-type record, typically by another step in the process flow.
- Event: BeforeRecordCreated