martinweiler commented on code in PR #7207:
URL: https://github.com/apache/incubator-kie/pull/7207#discussion_r4353167680
##########
kogito-jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/WorkItemModelMetaData.java:
##########
@@ -76,45 +82,209 @@ public class WorkItemModelMetaData {
private static final Logger LOGGER =
LoggerFactory.getLogger(WorkItemModelMetaData.class);
- private static final String TASK_INTPUT_CLASS_SUFFIX = "TaskInput";
- private static final String TASK_OUTTPUT_CLASS_SUFFIX = "TaskOutput";
+ @KieInternal
+ public static final String CONFLICTING_TYPES_ERROR_TEMPLATE = "Conflicting
types for %s parameter '%s' in task '%s' of process '%s': %s vs %s";
+ @KieInternal
+ public static final String MISMATCHED_DEFINITION_ERROR_TEMPLATE = "Cannot
share taskName '%s' between work items of different definition types ('%s' vs
'%s') in process '%s'";
+
+ private static final String TASK_INPUT_CLASS_SUFFIX = "TaskInput";
+ private static final String TASK_OUTPUT_CLASS_SUFFIX = "TaskOutput";
private static final String TASK_MODEL_CLASS_SUFFIX = "TaskModel";
- private static final String TASK_NAME = "TaskName";
+ private static final String TASK_NAME_PARAM = "TaskName";
private static final String WORK_ITEM = "workItem";
private static final String PARAMS = "params";
- private final String packageName;
+ public record ParameterDefinition(String originalKey, String
sanitizedName, String type) {
+ }
+ public record WorkItemNodeContext(WorkItemNode workItemNode, VariableScope
variableScope) {
+ }
+
+ private final String packageName;
private final VariableScope processVariableScope;
- private final VariableScope variableScope;
- private final WorkItemNode workItemNode;
+ private final String taskName;
private final String processId;
+ private Work work;
- private String inputModelClassName;
- private String inputModelClassSimpleName;
-
- private String outputModelClassName;
- private String outputModelClassSimpleName;
+ private final String inputModelClassName;
+ private final String inputModelClassSimpleName;
+ private final String outputModelClassName;
+ private final String outputModelClassSimpleName;
+ private final String taskModelClassName;
+ private final String taskModelClassSimpleName;
- private String taskModelClassName;
- private String taskModelClassSimpleName;
+ private final List<WorkItemNodeContext> nodes = new ArrayList<>();
+ private final Map<String, ParameterDefinition> inputParamDefs = new
LinkedHashMap<>();
+ private final Map<String, ParameterDefinition> outputParamDefs = new
LinkedHashMap<>();
- public WorkItemModelMetaData(String packageName, VariableScope
processVariableScope, VariableScope variableScope, WorkItemNode workItemNode,
String processId) {
+ public WorkItemModelMetaData(String packageName, VariableScope
processVariableScope, String taskName, String processId) {
this.packageName = packageName;
this.processVariableScope = processVariableScope;
- this.variableScope = variableScope;
- this.workItemNode = workItemNode;
+ this.taskName = taskName;
this.processId = processId;
- this.inputModelClassSimpleName =
sanitizeClassName(ProcessToExecModelGenerator.extractProcessId(processId) + "_"
+ workItemNode.getId().toExternalFormat() + "_" + TASK_INTPUT_CLASS_SUFFIX);
+ String classPrefix =
sanitizeClassName(ProcessToExecModelGenerator.extractProcessId(processId) + "_"
+ sanitizeClassName(taskName));
Review Comment:
What about two different tasks with names:
* `Rest Call`
* `Rest_Call`
Wouldn't those be grouped incorrectly?
--
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]