TPS investigates: CDM integration Troubleshooting

How to integrate CDM-features in an A12-project

:warning: CDM (short for: Compose Document Model) is currently rated as experimental :warning:

First consider the getA12 documentation for Simple Composed Data and the necessary steps to use it in the project. Follow this tutorial carefully, because there are many configurations to be set in the models, e.g. special CDM-annotations.

Technical Steps to add in client code

Extend the following in the appsetup.ts:

  • Add …createCdmMiddlewares() to the additionalMiddlewares
  • Add …dgReducers and …cddReducers to the dataReducers
  • Add …cdmSagas to the customSagas
  • Add cddDataProvider (:warning: this has to be the first in the list) and relationshipDataProvider to the dataProviders

If CRUDViews.OverviewEngineView aswell as CRUDViews.FormEngineView are used as containers in the projects there are no changes necessary for these. If custom Overview- FormEngines are used, then see the Troubleshooting Guide in order to fix potentially problems.

Troubleshooting Guide

There can be multiple reasons why CDM might not be working correctly in the project.

In the following there is a list containing some steps that could be checked when integrating this feature:

Issue Possible Solution
Detached Repeat is not displayed or Form doesn't open at all - Check if correct container is used in the appmodel with CDM feature.
- Try using CRUDViews implementation for OverviewEngine and FormEngine
- Check if a scene for the composed document in the detached repeat is defined in the appmodel
- Check if every scene with CDM feature has a match condition with feature: "SCDM" defined
invalid docRef error when trying to save a new entitiy linked to another entity Check if mgm.services.core.batch.spel.resolution.enabled=true is set in the application.properties of the server
Button press in deatched repeat not working Check if the cddDataProvider is at the top of the list in the dataProviders
After saving changes in CDM form, the console log contains errors with invalid engineState Check if custom middlewares are interfering and taking the CDM activity. If that is the case, either change every latestActivity-call in these middlewares with something more specific or add an if-statement to terminate when a CDM activity is dispatched. For this isCddDescriptor could be used.