简体   繁体   中英

How do I manage state of a node in Gentics Mesh?

I'm using an external BPM for content approval in Gentics Mesh and a content node may be in one of several states.

A requirement is to query all content nodes that have no state, or have a specific state.
Since we don't have field level permission on a node, I don't want to define a 'state' field in the content schema.

I was thinking of storing the state as a child node of the content item, using a schema where the system only has 'create' permissions.

Is this a good approach?

Otherwise I think I'd use an external database for state management, but this would make the system more complex.

-- Update --

More about the use-case:
We have content contributors that will upload media. The content needs to be reviewed by an editor, and will either be accepted or rejected with comments.
It's a simple workflow for now, but the requirements may change, so we want to leverage a full BPM. [and we have other BPM workflows].
So the state data would contain a status identifier + comments + possibly other arbitrary data in the future.

We're building a Mesh plugin that will consume/produce Kafka messages to interact with external systems, like the BPM.

We also need to manage notifications, where an editor will see an icon showing the number of unread notifications, and have an 'inbox' to view historical notifications [sounds similar to the 'must-read-plugin']
We have a 'user_profile' schema and I'm considering adding the notifications as nodes there.

You could use tags to model the state of a node. Tags would however not be language, version or branch specific. Aside of this I think this might be a valid point for a product enhancement.

See https://github.com/gentics/mesh-incubator/issues/187 for details.

In most other cases where such a state needed to be modeled we build plugins which tracked the state. The data for the state was in those cases saved in extra nodes which were managed by the plugin.

One example that comes to mind was the must-read-plugin which stored the "node has been read by user xyz" state. It would create dedicated nodes which would store this information in a folder which was managed by the plugin ( /must-read/:nodeUuid-:userUuid ).Those nodes would have a urlField value which could be loaded very fast and thus the checks could be done very efficiently.

Could you perhaps describe your actual usecase in the mentioned ticket. I think this would help us with the planning of the workflow feature. Thank you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM