Hi everyone, I have a button on a cdm view that creates a document and adds it to the current document’s data.
but I have no idea how I can update the fronend view.
can anyone help me in this topic.
The button in the picture creates another subcontract, but I cannot refresh the view using
yield put(ActivityActions.reloadData({ activityId}));
I have an error that says Nothing to be loaded, since there is no missing path.
Hi,
first of all: CDMs are currently provided as a “modelling only” feature. I.e there are no public extension/customization APIs for this functionality yet.
I’m not sure I fully understand what you try to achieve. I’m assuming the following:
Your detail view (on the right side) is presenting a contract (CDM) and sub contracts are linked to contracts via a relationship model. The linked sub contracts are rendered with a table list component.
Now, I’m not sure how you implemented the “add sub contract” logic that is executed on button click.
The CDM feature is based on a document graph data structure that holds documents and links. From this data structure, a composed document (CDD) is constructed and used as the data for the Form Engine to work on.
Any data change from the form engine needs to be transformed into operations on the document graph.
In your case, you would need to add a document and a link since you add a sub contract and you want to assign it to the current contract. We call this “create and link” in one step.
For this, we have an explicit modelling approach using CDM child activities that enables you do exactly that. Please check whether this would fit your use case.
Hi @z.ghafarnasab,
did you find the response helpful or should the question remain open for more clarifications? If the response answered your question, please mark it as the solution via the checkbox-icon.
Thanks ahead for your feedback and have a nice rest of the day!
Best,
Denise from the Discourse Team