Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-12761

Multi Param Model Service Map

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Done
    • 22.01.01, Upcoming Branch
    • None
    • framework/service
    • Patch

    Description

      Hello community.

      We had a use case with the need for validation of IN params of services.
      For example we had to check that the following service definition was correctly filled.

      ```xml
          <service name="exampleService" location="component:..."
              invoke="exampleService" transaction-timeout="7200">
              <description> Service example use case with internal attributes to validate </description>
              <implements service="ApiJsonInterface"/>
              <attribute name="partyId" type="String" mode="IN"/>
              <attribute name="header" type="java.util.Map" mode="IN">
                  <attribute name="internal_code" type="String" optional="false"/>
              </attribute>
          </service>
      ```

      As is, the framework doesn't offer any clean way of doing this, so we implemented some modification to ModelService.
      So we used TDD to develop the improvement we needed and that may prove a valuable improvement for the framework.
      Using these tests, we took the opportunity to refactor outdated code using java streams.

      Please see the patch attached to the ticket containing code and tests.

      Attachments

        1. MultiParamServiceMapAndTest.patch
          56 kB
          Gaetan Chaboussie

        Activity

          People

            nmalin Nicolas Malin
            Gaetan Chaboussie Gaetan Chaboussie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: