简体   繁体   English

如何管理 Gentics Mesh 中节点的 state?

[英]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.我在 Gentics Mesh 中使用外部 BPM 进行内容批准,并且内容节点可能处于多种状态之一。

A requirement is to query all content nodes that have no state, or have a specific state.一个要求是查询没有 state 或具有特定 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.我正在考虑使用系统仅具有“创建”权限的模式将 state 存储为内容项的子节点。

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.否则我想我会使用外部数据库进行 state 管理,但这会使系统更加复杂。

-- 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.目前这是一个简单的工作流程,但需求可能会发生变化,因此我们希望利用完整的 BPM。 [and we have other BPM workflows]. [我们还有其他 BPM 工作流程]。
So the state data would contain a status identifier + comments + possibly other arbitrary data in the future.因此,state 数据将包含状态标识符 + 注释 + 未来可能还有其他任意数据。

We're building a Mesh plugin that will consume/produce Kafka messages to interact with external systems, like the BPM.我们正在构建一个 Mesh 插件,它将使用/生成 Kafka 消息以与外部系统(如 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.我们有一个“user_profile”模式,我正在考虑将通知添加为那里的节点。

You could use tags to model the state of a node.您可以对节点的 model 和 state 使用标签。 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.有关详细信息,请参阅https://github.com/gentics/mesh-incubator/issues/187

In most other cases where such a state needed to be modeled we build plugins which tracked the state.在大多数其他需要对此类 state 建模的情况下,我们构建了跟踪 state 的插件。 The data for the state was in those cases saved in extra nodes which were managed by the plugin.在这些情况下,state 的数据保存在插件管理的额外节点中。

One example that comes to mind was the must-read-plugin which stored the "node has been read by user xyz" state.想到的一个例子是必须阅读的插件,它存储了“节点已被用户 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.它将创建专用节点,将这些信息存储在由插件管理的文件夹中( /must-read/:nodeUuid-:userUuid )。这些节点将具有 urlField 值,可以非常快速地加载,因此检查可以非常有效地完成。

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.谢谢你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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