martinweiler commented on code in PR #7204:
URL: https://github.com/apache/incubator-kie/pull/7204#discussion_r4316075083
##########
kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/process/ProcessResourceGenerator.java:
##########
@@ -372,13 +379,74 @@ protected void
generateSignalsEndpoints(TemplatedGenerator.Builder templateBuild
vv.setString(interpolated);
});
});
+ if (hasDynamicSignals) {
+ generateDynamicSignalEndpoint(
+ template,
+ signalInstanceDeclaration,
+ index);
+ }
});
}
private boolean isDynamicSignalName(String signalName) {
return signalName != null && signalName.matches(".*#\\{.*\\}.*");
}
+ private void generateDynamicSignalEndpoint(ClassOrInterfaceDeclaration
template,
Review Comment:
As this duplicates the code from lines 353-380, I think it would be cleaner
to rename this method to something like `addSignalInstanceEndpoint(...)` and
call it in both code paths (regular signals and dynamic ones). The
`methodName`, `signalName`, `signalType` could be passed in as method
parameters.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]