GopikaReghunath commented on code in PR #4273:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4273#discussion_r3246338402
##########
kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/usertask/RestResourceUserTaskQuarkusTemplate.java:
##########
@@ -273,4 +333,65 @@ public Attachment getAttachment(
.orElseThrow(() -> new
UserTaskInstanceNotFoundException("Attachment " + attachmentId + " not found"));
}
+ @GET
+ @Path("/{taskName}/schema")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map<String, Object> getSchemaByTaskName(
+ @PathParam("taskName") String taskName,
+ @QueryParam("user") String user,
+ @QueryParam("group") List<String> groups) {
Review Comment:
We tried the scenarios as mentioned by @josedee and below observations were
made example used is process-user-tasks-subsystem (hiring.bpmn is the process)
Two different processes with same task name and different schema
created a test process (test.bpmn) with taskName hr_interview
input: interview_in output: interview_out, while hitting schema endpoint with
taskName as hr_interview only the schema details from hiring.bpmn process is
returned and the test process is ignored
Same process with two tasks with same task name
To test this we renamed it_interview to hr_interview in
hiring.bpmn (The input/output of both these tasks are different the original
hr_interview has hr_approval while it_interview which is renamed to
hr_interview has it_approval) and hit the schema endpoint. The response had
both it_approval and hr_approval, Attaching a sample response for second
scenario
`URL : http://localhost:8080/usertasks/hr_interview/schema`
`{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$defs": {
"Candidate": {
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"position": {
"type": "string"
}
}
}
},
"type": "object",
"properties": {
"candidate": {
"$ref": "#/$defs/Candidate",
"input": true
},
"it_approval": {
"type": "boolean",
"input": true,
"output": true
},
"hr_approval": {
"type": "boolean",
"input": true,
"output": true
}
}
}`
cc: @martinweiler @pefernan
--
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]