/[Apache-SVN]
ViewVC logotype

Revision 1838349


Jump to revision: Previous Next
Author: nmalin
Date: Sat Aug 18 21:23:31 2018 UTC (5 years, 8 months ago)
Changed paths: 9
Log Message:
Improved: Refactoring ContactMechWorker.get[Entity]ContactMechValueMaps function to improve processing speed
(OFBIZ-10514)
ContactMechWorker.get[Entity]ContactMechValueMaps are old historic functions that resolve all contact mech context related to an Entity (Party, Facility, Order, WorkEffort).
The problem that they create too many db call during their execution that decrease OFBiz performance when the contactMech history grow.

A solution use to improve the process speed was replace all db call through *GenericValue.getRelated* function by *Delegator.makeValidValue* to instanciate each GenericValue needed after an unique search call on a viewEntity. For the four entities : Party, Facility, Order and WorkEffort, I use the same view structure with a sub view entity on ContactMechDetail. This offer more genericity and permit to slim code.

This commit introduce a regression on genericValue resolved for ContactMechType and ContactMechPurposeType that currently lost their description, it's actually not awkward because theses genericValue use the function .get("description", locale) to resolve the description so call directly the label system.

For Order and WorkEffort, I merged the resolving process in one function, that can be extend later easily for some other entity like Invoice or Quote.
The new FtpAddress wasn't managed by this worker so I introduce it to keep the coherence.

Last improvement, I use 
   getPartyContactMechValueMaps(Delegator delegator, String partyId, Timestamp date, String contactMechTypeId) 
instead of
   getPartyContactMechValueMaps(Delegator delegator, String partyId, boolean showOld, String contactMechTypeId) 
to offert also more possibility to resolve at date instead just use now or all.

icing on the cake, I added groovy test to control this worker

Changed paths

Path Details
Directoryofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/order-entitymodel.xml modified , text changed
Directoryofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/party-entitymodel.xml modified , text changed
Directoryofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/product-entitymodel.xml modified , text changed
Directoryofbiz/ofbiz-framework/trunk/applications/party/groovyScripts/test/ added
Directoryofbiz/ofbiz-framework/trunk/applications/party/groovyScripts/test/ContactMechWorkerTests.groovy added
Directoryofbiz/ofbiz-framework/trunk/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechWorker.java modified , text changed
Directoryofbiz/ofbiz-framework/trunk/applications/party/testdef/PartyContactMechTests.xml modified , text changed
Directoryofbiz/ofbiz-framework/trunk/applications/party/testdef/data/PartyContactMechTestData.xml modified , text changed
Directoryofbiz/ofbiz-framework/trunk/applications/workeffort/entitydef/entitymodel_view.xml modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26