You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/09/19 13:08:00 UTC

[jira] [Closed] (OFBIZ-13601) Multiple regressions and one pre-existing bug in WorkEffortServicesScript.groovy (workeffort/party-assignment/duplication paths)

     [ https://issues.apache.org/jira/browse/OFBIZ-13601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak closed OFBIZ-13601.
---------------------------------
    Fix Version/s: Upcoming Branch
                   24.09.08
       Resolution: Fixed

> Multiple regressions and one pre-existing bug in WorkEffortServicesScript.groovy (workeffort/party-assignment/duplication paths)
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13601
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13601
>             Project: OFBiz
>          Issue Type: Bug
>          Components: workeffort
>    Affects Versions: Upcoming Branch, 24.09.07
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Major
>             Fix For: Upcoming Branch, 24.09.08
>
>
> h3. Needs fixing
> {{applications/workeffort/src/main/groovy/org/apache/ofbiz/workeffort/workeffort/workeffort/WorkEffortServicesScript.groovy}} has five distinct issues, four of them regressions introduced by the minilang→Groovy conversions (OFBIZ-12965, OFBIZ-12968) and one pre-existing bug in code that has always been native Groovy (not a minilang conversion):
> * {{checkAndCreateWorkEffort()}} references an undeclared variable {{serviceResultAD}} instead of the {{serviceResult}} declared two lines above, when building the {{estimatedArrivalWorkEffId}} for a shipment's arrival WorkEffort. This throws {{MissingPropertyException}} every time {{parameters.estimatedArrivalDate}} is set — i.e. on essentially every shipment create/update that has an estimated arrival date. Needs fixing: change {{serviceResultAD.workEffortId}} to {{serviceResult.workEffortId}}. (Native Groovy since 2020, not a minilang regression, but a real, severe, live bug in this file.)
> * {{copyWorkEffort()}}, when {{parameters.copyRelatedValues == 'Y'}} and {{parameters.excludeExpiredRelations == 'Y'}}, calls {{EntityUtil.filterByDate(relationValues)}} unconditionally for every "many" relation of {{WorkEffort}} except {{WorkEffortAssoc}}. Several of those relations (e.g. {{WorkEffortStatus}}, which every WorkEffort has at least one row of) don't have a {{fromDate}} field, so {{EntityUtil.filterByDate}} throws {{IllegalArgumentException}}. The pre-conversion minilang guarded this per-entity with an explicit "does this entity even have a fromDate field" check before filtering; that guard was dropped. Needs fixing: re-add a check that the target entity actually has a {{fromDate}} field before calling {{EntityUtil.filterByDate}}.
> * {{assignPartyToWorkEffort()}} and {{updatePartyToWorkEffortAssignment()}} write the map key {{statusDatetime}} (lowercase "t") when calling {{createWorkEffortPartyAssignment}}/triggering the workflow-engine update, but the actual {{WorkEffortPartyAssignment}} entity field (and the corresponding service attribute) is {{statusDateTime}} (capital "T"). Because context validation is case-sensitive, the value is silently dropped and the field is never actually persisted, unlike minilang which always stamped it. Needs fixing: correct the casing to {{statusDateTime}} in both methods.
> * {{quickAssignPartyToWorkEffort()}} backs both the {{quickAssignPartyToWorkEffort}} and {{quickAssignPartyToWorkEffortWithRole}} services (same {{invoke}} target in servicedef). Pre-conversion minilang had two separate methods: the plain variant always set {{statusId='PRTYASGN_ASSIGNED'}} with {{roleTypeId='CAL_OWNER'}}, while the WithRole variant set {{statusId='CAL_ACCEPTED'}} with a caller-supplied {{roleTypeId}}. The merged Groovy method always hardcodes {{statusId: 'PRTYASGN_ASSIGNED'}}, so the WithRole variant's intended {{CAL_ACCEPTED}} status is never set. Needs fixing: branch on which service was invoked (or on whether a non-default {{roleTypeId}} was supplied) to preserve both original status values.
> * {{duplicateWorkEffort()}}'s shared {{duplicateWorkEffortAssoc()}} helper calls {{.filterByDate()}} whenever the target relation entity has a {{fromDate}} field, which is true for both {{WorkEffortAssoc}} and {{WorkEffortContent}}. Pre-conversion minilang never date-filtered either of these when duplicating them — it copied all rows unconditionally. This means {{duplicateWorkEffortAssocs='Y'}}/{{duplicateWorkEffortContents='Y'}} now silently omit expired associations/content that minilang used to copy. Needs fixing: drop the date filter for these two relations (or make it explicitly opt-in, matching minilang's actual behavior).
> Acceptance criteria: all five issues above are fixed, with regression tests covering at least the {{copyWorkEffort}} crash and the {{quickAssignPartyToWorkEffortWithRole}} status value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)