[
https://issues.redhat.com/browse/DROOLS-2222?page=com.atlassian.jira.plug...
]
Roger Martinez commented on DROOLS-2222:
----------------------------------------
Hey [~manstis] [~karreiro] [~vpellegr]
Lemme share a few ideas behind this task, maybe those help to clarify how to achieve
this.
Consider these general ideas:
* All actions/operations in Stunner are _command_ based - everything that the user does,
can be a click, can be dragging something, or clicking on some button, it ends up in a
command instance, which gets executed and results on some changes on the model/canvas.
This way, commands are reusable and can be undone, redone, etc
* So focusing on the _clone_ operation - it also exist a command in the Stunner core for
clonning model instances, see
[
CloneNodeCommand|https://github.com/kiegroup/kie-wb-common/blob/8eb1af188...]
* Also consider that each domain, it can be BPMN or DMN, can declare its own command
implementations, it means that we can use different implementation when cloning a node,
depending on the domain
Soo I would rely on commands in order to implement the custom cloning behavior for DMN:
* Create a new CloneNodeCommand implementation for DMN, and use it in the
DMNCommandFactory
* This new CloneNodeCommand implementation for DMN can inject or declare a custom
CloneManager instance as well, or use whatever clone algorithm you've avaiblable
Note about _CloneManager_ and its CDI related usage :
* By looking at actual code I've seen that the CloneManager is being injected by the
DefinitionManager, so the CloneNodeCommand is just using this instance, but this means
that you cannot rely on CDI to obtain a different CloneManager instance
* It's because on the implementation for any command class, there is no CDI context,
you cannot create injection points in the Command classes itself, they're statefull
and portable, and no context dependencies are expected
* So if you're plannign to create a "custom" CloneManager for DMN, we'll
have to see how to use it in the command class, maybe we can change some getter in the
DefinitionManager to allow it...
Please try to read and understand the points above and let's see next steps and how
this fit, let's keep in touch!
Thanks!
Stunner: Ensure "copy/paste" (nodes) supports DMN's
deep definition
-------------------------------------------------------------------
Key: DROOLS-2222
URL:
https://issues.redhat.com/browse/DROOLS-2222
Project: Drools
Issue Type: Sub-task
Components: DMN Editor, Stunner
Reporter: Michael Anstis
Assignee: Tiago Dolphine
Priority: Major
As discussed on DROOLS-2214 Stunner needs to support (or provide extension points) for
DMN's "copy/paste" of a {{Node}} to also deep-clone the definition. Please
either (a) use this JIRA to record any changes needed in Stunner, (b) provide an
explanation of how DMN can override the copy/paste to deep-clone definitions. Thanks.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)