Bug 1082029
Summary: | Exclude unnecessary elements (results) in the rest JaxbWorkItem reply | ||
---|---|---|---|
Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Anton Giertli <agiertli> |
Component: | Business Central | Assignee: | Marco Rietveld <mrietvel> |
Status: | CLOSED CANTFIX | QA Contact: | Ivo Bek <ibek> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 6.0.1 | CC: | agiertli, ibek, kverlaen, smcgowan |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-11-25 18:14:15 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Anton Giertli
2014-03-28 14:01:42 UTC
Also, the same issue might be applicable also for output for some other queries, not just this particular one. Hi Anton, The results element refers to the data submitted when completing the WorkItem. If you were doing this locally (instead of via REST), you would do it with this method: org.kie.api.runtime.process.WorkItemManager.completeWorkItem(long, Map<String, Object>) The Map contains the "results" that are added to the WorkItem. With REST, at the moment, you can only add results that are Strings, Integers or Longs. You add them via "map query parameters". Hmm, this is *NOT* documented well in the product documentation. :/ Will fix that this week. It is documented here: https://hudson.jboss.org/hudson/job/droolsjbpm-knowledge/lastSuccessfulBuild/artifact/kie-docs/jbpm-docs/target/docbook/publish/en-US/html/jBPMRemoteAPI.html See [17.2.6.5. Map query parameters] and the explanation for "/runtime/{deploymentId}/workitem/{workItemId}/complete" in [17.2.1.1. Process calls]. Anton, would it be okay to close this bug as NOTABUG? If there are other things that are not clear, please let me know! Hi Marco, thanks for that resource. Though one thing is still unclear. Let me rephrase maybe a little bit. 1) I call /runtime/{deploymentId}/workitem/{workItemId} result element is empty 2) I call /runtime/{deploymentId}/workitem/{workItemId}/complete?map_key=value output is <status>SUCCESS</status> 3) I call /runtime/{deploymentId}/workitem/{workItemId} again - workitem is already completed, the result is NPE (probably some other message once that will be fixed, informing me that workitemid I have supplied is not valid anymore) My point is user can never actually see the content of <result> element. If he queries it before the workitem is finished - it is empty, obviously. If he queries that workitem after it is completed, the response is empty completely. So question is - why to bother even showing this <result> element at all if it always will be empty ? ================================================ Is there *any* scenario when I will receive an answer when this element (result) will contain something ? I understand that result is used internally for completing workitem, but for this particular query GET /runtime/{deploymentId}/workitem/{workItemId} it will never be filled with values, at least from what I can see. ================================================ It's not really an issue, more like a cosmetic thing, so if the overhead for solving it is too high then it is simply not worth it. There is still a possibility that I've got this completely wrong though I hope I have expressed myself more clearly this time. Cheers, Anton For administrative purposes, I've removed the 6.2.0+ flag, seeing as this bug is on the line between a bug and a feature (both?) and easy enough to fix. Anton and Ivo, I tried to fix the bug -- and then realized I couldn't! The JaxbWorkItemResponse object is used as the REST DTO for the WorkItem implementation. https://github.com/droolsjbpm/droolsjbpm-knowledge/blob/master/kie-api/src/main/java/org/kie/api/runtime/process/WorkItem.java#L106 https://github.com/droolsjbpm/droolsjbpm-integration/blob/6.2.x/kie-remote/kie-remote-jaxb/src/main/java/org/kie/services/client/serialization/jaxb/impl/process/JaxbWorkItemResponse.java#L22 The WorkItem implementation mandates a getResults() method. It's possible to include the method and not include the field, but that's not something I'm going to do: if the field is ever used, then the method and object should make sure to provide that information. |