Bug 1315636

Summary: Type information is lost when using JSON Marshaller for sending GetObject command to KieServer
Product: [Retired] JBoss BRMS Platform 6 Reporter: Anton Giertli <agiertli>
Component: Kie-ServerAssignee: Maciej Swiderski <mswiders>
Status: CLOSED DUPLICATE QA Contact: Karel Suta <ksuta>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.2.0CC: alazarot
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1315767 (view as bug list) Environment:
Last Closed: 2016-04-07 02:07:48 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:
Bug Depends On: 1283208    
Bug Blocks: 1315767    

Description Anton Giertli 2016-03-08 09:50:43 UTC
Description of problem:
If you send GetObject command using JSON to the KieServer, the type information is lost.

The type information is present when using XStream for example, 

Version-Release number of selected component (if applicable):

BRMS 6.2.1

How reproducible:

always
Steps to Reproduce:
1. Deploy some KJAR onto the KieServer
2. Insert some custom object into the KieSesession and call GetObject command to retrieve it
3. If you use JSON marshaller, the type information for this Custom Object is lost


Sample client code for interacting with the KieServer
https://gist.github.com/agiertli/d8ee2ab934cf1987097b

The server response of the above call is this:

{
  "results" : [ {
    "key" : "insert-identifier",
    "value" : {"org.Person":{
  "name" : "anton"
}}
  }, {
    "key" : "get-obj-response",
    "value" : [ {
  "name" : "anton"
} ]
  }, {
    "key" : "fire-identifier",
    "value" : 0
  } ],
  "facts" : [ {
    "key" : "insert-identifier",
    "value" : {"org.drools.core.common.DefaultFactHandle":{
  "external-form" : "0:1:823286421:823286421:1:DEFAULT:NON_TRAIT:org.Person"
}}
  } ]
}

The object inserted is of type org.Person - as you can see, under "get-obj-response" this type is simply not listed.

The response could look like this:

"results" : [ {
    "key" : "responseObjects",
    "value" : [
{"org.Person":{
  "name" : "anton",...
}},
...

Actual results:
 Type information about the custom object is lost, when sending GetObject command to KieServer using JSON

Expected results:

 Type information about the custom object is lost, when sending GetObject command to KieServer using JSON
Additional info:

Comment 4 Karel Suta 2016-03-14 12:45:10 UTC
This issue was already fixed for 6.3.0 by https://github.com/droolsjbpm/droolsjbpm-integration/pull/253.

Comment 5 Edson Tirelli 2016-04-07 02:07:48 UTC

*** This bug has been marked as a duplicate of bug 1283208 ***