One solution we could apply is storing the mapping in the SystemProperty
entity, like:
{code}
<SystemProperty systemResourceId="workeffort" systemPropertyId=
"calendarType.CAL_MAINTENANCE" systemPropertyValue="WEPT_MAINTENANCE"
description="Calendar Type to Work Effort Purpose Type association"/>
{code}Best regards, Pierre Smits ORRTIZ.COM <http://www.orrtiz.com> OFBiz based solutions & services OFBiz Extensions Marketplace http://oem.ofbizci.net/oci-2/ On Wed, Mar 23, 2016 at 1:00 PM, Pierre Smits <[email protected]> wrote: > HI all, > > [pre-amble] > Currently, the workeffort component is also housing functionalities for > calendars. For this we have the following datasets: > > - <EnumerationType description="Calendar Type" > enumTypeId="CALENDAR_TYPE" hasTable="N" parentTypeId=""/> > - <Enumeration description="Personal Calendar" enumCode="PERSONAL" > enumId="CAL_PERSONAL" sequenceId="01" enumTypeId="CALENDAR_TYPE"/> > - <Enumeration description="Manufacturing Calendar" > enumCode="MANUFACTURING" enumId="CAL_MANUFACTURING" sequenceId="02" > enumTypeId="CALENDAR_TYPE"/> > - <Enumeration description="None" enumId="CAL_NONE" sequenceId="03" > enumTypeId="CALENDAR_TYPE"/> > > The Enumerations mentioned above are used in functions to help filtering > the overview of calendar items in the calendar screen(s), as per function > getDefaultWorkEffortExprList in WorkEffortServices.java. > > [case] > Calendars are applied in various business domains to serve specific > purposes. We can consider the following: > > - personal calendar > - manufacturing calendar > - maintenance calendar > - project calendar > - etc. > > We have only the first two defined and we have hardcoded the filtering > conditions (based on the workEffortTypeId). > > [suggestion] > > 1. We should remove the hardcoded filtering based on the workEffortType > 2. We should remove the hardcoded definitions > 3. Association of CALENDAR_TYPE to the WorkEffort records should be > based on a mapping. > > [discussion] > What are your thoughts on this? Should we have the mapping (item #3) in an > existing entity, and which one should that be? What are the aspect to > consider when refactoring this. > > I love to hear from you. > > Best regards, > > Pierre Smits > > ORRTIZ.COM <http://www.orrtiz.com> > OFBiz based solutions & services > > OFBiz Extensions Marketplace > http://oem.ofbizci.net/oci-2/ >
