[KULRICE-8179] Rice KEW considers Maps as 'simple' properties and serializes them and persists them in the database. Created: 12/Sep/12  Updated: 10/Jun/13  Resolved: 27/Sep/12

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: None
Fix Version/s: 2.1.3
Security Level: Public (Public: Anyone can view)

Type: Improvement Priority: Major
Reporter: Gayathri Athreya Assignee: Sona Sona (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relate
is related to KULRICE-9438 Not able to edit rules that have attr... Closed
Rely
Rice Module:
KRAD
KRAD Feature Area:
KEW Integration
Application Requirement:
KC
KAI Review Status: Not Required
KTI Review Status: Not Required

 Description   

KC Time and Money documents are persisting a decent amount of data into the KREW_DOC_HDR_CNTNT_T table because the 'document' contains a number of 'simple' hashmaps.

This happens in PropertySerializerTrie.addSerializablePropertyName when the propertyName 'document' is passed in. Which always happens as the document should be persisted. It then sets that object to serialize all simple properties. In PropertySerializabilityEvaluatorBase.determinePropertyType it determine primitive objects to be anything that is not a BO and a Collection. As Maps are neither, all maps on our documents are persisted in the Doc Content XML. This seems to be an oversight as collections are not included and should be reviewed.

Should maps be a separate property type in determinePropertyType or is there a better way to use the workflowProperties to control which properties on the document are serialized and thereby not serialize unnecessary maps on KC documents. KC currently has a few documents that have multiple maps in them and serializing these documents leads to a large amount of data being persisted in the database.



 Comments   
Comment by Peter Giles (Inactive) [ 20/Sep/12 ]

Gayathri, this jira is for trans docs and KULRICE-8180 is for maintenance documents, right? Thanks

Comment by Gayathri Athreya [ 20/Sep/12 ]

Yes Peter, correct.

Comment by Sona Sona (Inactive) [ 21/Sep/12 ]

Gayathri, Could you send me the steps to reproduce this issue on http://test.kc.kuali.org/kc-dly/portal.do. Thanks

Comment by Gayathri Athreya [ 21/Sep/12 ]

Hi Sona, in order to reproduce this, you can open up any document that uses HashMaps. In KC, you can try to create an Award document. Click on the green + button on the central admin panel next to Awards. Now try to fill in the required fields as follows:

Description: Test
Transaction Type: Administrative Amendment
Lead Unit ID : 000001
Activity Type : Research
Award Type: Grant
Award Title: Test
Award Status: Active
Sponsor ID: 000340
Project End date: 09/30/2012

Now try to save the award. When you do so, if you put a breakpoint at the "return PropertyType.Primitive" line in the determinePropertyType method in PropertySerialiabilityEvaluatorBase class, you will notice that when HashMaps are passed in as propertyValues, the PropertyType for those are returned as PropertyType.PRIMITIVE. In the AwardDocument, one such HashMap is the customAttributeDocuments HashMap. If you look in the xml persisted for the document (you can do this through the Document operation link in the Sys admin panel) , you will notice that this custmAttributeDocuments map is persisted by default because it is considered a primitive type.

Comment by Gayathri Athreya [ 21/Sep/12 ]

If this is complicated please do not hesitate to ping me on Skype.

Comment by Sona Sona (Inactive) [ 21/Sep/12 ]

Got it. Thanks. I was trying to manipulate the Award from the Researcher tab and kept running into 'document is locked ' errors.

Comment by Sona Sona (Inactive) [ 27/Sep/12 ]

Added Map as another property type.

Comment by Gayathri Athreya [ 27/Sep/12 ]

Thanks Sona, will this fix be part of 2.1.3 when that branch is created?

Comment by Sona Sona (Inactive) [ 27/Sep/12 ]

Hi Gayathri, Yes this will be part of 2.1.3.

Comment by Gayathri Athreya [ 27/Sep/12 ]

great, thanks!

Comment by Gayathri Athreya [ 17/Jan/13 ]

Maps no longer considered 'simple' property. Works as expected, closing issue.

Generated at Tue Sep 29 14:52:58 CDT 2020 using JIRA 7.0.11#70121-sha1:19d24976997c1d95f06f3e327e087be0b71f28d4.