-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[incubator-kie-issues#1478] Register DRG callbacks to assigned models from DMNCompilerImpl #6105
base: main
Are you sure you want to change the base?
[incubator-kie-issues#1478] Register DRG callbacks to assigned models from DMNCompilerImpl #6105
Conversation
👀 |
Hi @samuel-beniamin thanks for the PR.
So, I was thinking to
The idea would be to have Wdyt ? Does this make sense ? Do you think you could do that ? |
Hello @gitgabrio, Thank you for taking the time to review the code and for your suggestions. I think your suggestions make sense, I believe I understood what need to be done, and I will be happy to make these changes in this PR as well, if that is okay. |
@@ -491,9 +493,30 @@ private void processDrgElements(DMNCompilerContext ctx, DMNModelImpl model, Defi | |||
public interface AfterProcessDrgElements { | |||
void callback(DMNCompilerImpl compiler, DMNCompilerContext ctx, DMNModelImpl model); | |||
} | |||
|
|||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @samuel-beniamin
IINW this is signavio-only behaviour that get to the core code: if so, could you please remove and move to signavio module ? Thanks!
private DMNCompilerConfiguration dmnCompilerConfig; | ||
private Deque<DRGElementCompiler> drgCompilers = new LinkedList<>(); | ||
private final DMNCompilerConfiguration dmnCompilerConfig; | ||
private final Deque<DRGElementCompiler> drgCompilers = new LinkedList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @samuel-beniamin
IINW this is signavio-only behaviour that get to the core code: if so, could you please remove and move to signavio module ? Thanks!
@@ -123,6 +121,7 @@ public class DMNCompilerImpl implements DMNCompiler { | |||
drgCompilers.add( new KnowledgeSourceCompiler() ); // keep last as it's a void compiler | |||
} | |||
private final List<AfterProcessDrgElements> afterDRGcallbacks = new ArrayList<>(); | |||
private final Map<DMNModel, List<AfterProcessDrgElements>> afterDRGcallbacksForModel = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @samuel-beniamin
IINW this is signavio-only behaviour that get to the core code: if so, could you please remove and move to signavio module ? Thanks!
/** | ||
* Adds a callback that will be invoked after the DRG elements have been processed, for a given model. | ||
*/ | ||
public void addCallbackForModel(AfterProcessDrgElements callback, DMNModel model) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @samuel-beniamin
IINW this is signavio-only behaviour that get to the core code: if so, could you please remove and move to signavio module ? Thanks!
|
||
@BeforeAll | ||
static void setup() { | ||
String modelName = "LocalHrefs"; | ||
parent = new TDefinitions(); | ||
parent.setName(modelName); | ||
parent.setNamespace(nameSpace); | ||
|
||
DMNCompilerConfiguration config = DMNFactory.newCompilerConfiguration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @samuel-beniamin
IINW this is signavio-only behaviour that get to the core code: if so, could you please remove and move to signavio module ? Thanks!
@@ -76,4 +98,27 @@ void getRootElement() { | |||
retrieved = DMNCompilerImpl.getRootElement(elementReference); | |||
assertThat(retrieved).isNotNull().isEqualTo(parent); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @samuel-beniamin
IINW this is signavio-only behaviour that get to the core code: if so, could you please remove and move to signavio module ? Thanks!
Hello @gitgabrio Well, I tried the approach of the a separate subclass for Signavio specific things, I have some observation and a conclusion:
I have a question, do you know a way with which I can integrate the new compiler into the code by any means, I had the impression that the compiler is not intended to be changed but extended through the If I am correct on the previous point, I would actually close this ticket after rethinking this part and also close the ticket, since this is the way the compiler was meant to be extended actually. |
First of all, many thanks @samuel-beniamin for all that. |
Closes incubator-kie-issues/1478