Service Call Bug

If I have a service called test#ArrayInput that is called through the service runner like this: /qapps/tools/Service/ServiceRun?doingRun=Y&serviceName=uniquely-me.UniquelyMeCalendarServices.test%23ArrayInput some weird behavior happens.

Summary:
In the first service where the inputList parameter is actually put into the entity-find, no output is generated despite both versions being an ArrayList with the same data. It will work if the inputList variable is specified anywhere in the service, but not if it’s called through the ServiceRun GUI. I can’t seem to figure out what the problem is any ideas @jonesde or others?

test#ArrayInput (Should be working)
    <service verb="test" noun="ArrayInput">
        <in-parameters>
            <parameter name="inputList" type="List" required="true"/>
        </in-parameters>
        <out-parameters>
            <parameter name="outputList" type="List"/>
        </out-parameters>
        <actions>
            <log level="warn" message="inputList=${inputList}"/>
            <log level="warn" message="inputList.getClass().getName()=${inputList.getClass().getName()}"/>
            <entity-find entity-name="moqui.basic.Enumeration" list="enumerationList">
                <econdition field-name="enumTypeId" operator="in" from="inputList"/>
            </entity-find>
            <log level="warn" message="enumerationList*.enumId=${enumerationList*.enumId}"/>
            <set field="outputList" from="enumerationList*.enumId"/>
        </actions>
    </service>

This will then give an output of

Output (NOT as expected)

Logs:

23:28:08.103  WARN 4126860-1906           o.moqui.i.c.LoggerFacadeImpl inputList=['PartyRelationshipType',  'WorkEffortPurpose',  'WorkEffortResolution',  'PaymentType',  'GeoType']
23:28:08.103  WARN 4126860-1906           o.moqui.i.c.LoggerFacadeImpl inputList.getClass().getName()=java.util.ArrayList
23:28:08.104  WARN 4126860-1906           o.moqui.i.c.LoggerFacadeImpl enumerationList*.enumId=[]

Then if you switch the from to an inline ArrayList, then it will provide the right output.

test#ArrayInput (Is actually working)
    <service verb="test" noun="ArrayInput">
        <in-parameters>
            <parameter name="inputList" type="List" required="true"/>
        </in-parameters>
        <out-parameters>
            <parameter name="outputList" type="List"/>
        </out-parameters>
        <actions>
            <log level="warn" message="inputList=${inputList}"/>
            <log level="warn" message="inputList.getClass().getName()=${inputList.getClass().getName()}"/>
            <entity-find entity-name="moqui.basic.Enumeration" list="enumerationList">
                <econdition field-name="enumTypeId" operator="in" from="['PartyRelationshipType', 'WorkEffortPurpose', 'WorkEffortResolution', 'PaymentType', 'GeoType']"/>
            </entity-find>
            <log level="warn" message="enumerationList*.enumId=${enumerationList*.enumId}"/>
            <set field="outputList" from="enumerationList*.enumId"/>
        </actions>
    </service>

This will then give an output of

Output (as expected)

Logs:

23:25:47.629  WARN 4126860-1925           o.moqui.i.c.LoggerFacadeImpl inputList=['PartyRelationshipType',  'WorkEffortPurpose',  'WorkEffortResolution',  'PaymentType',  'GeoType']
23:25:47.629  WARN 4126860-1925           o.moqui.i.c.LoggerFacadeImpl inputList.getClass().getName()=java.util.ArrayList
23:25:47.629  WARN 4126860-1925           o.moqui.i.c.LoggerFacadeImpl enumerationList*.enumId=[GEOT_GROUP, GEOT_REGION, GEOT_SALES_REGION, GEOT_SERVICE_REGION, GEOT_CITY, GEOT_STATE, GEOT_POSTAL_CODE, GEOT_COUNTRY, GEOT_COUNTY, GEOT_COUNTY_CITY, GEOT_MUNICIPALITY, GEOT_PROVINCE, GEOT_TERRITORY, PtDisbursement, PtRefund, PtInvoicePayment, PtPrePayment, PtPrePaymentInventory, PtFinancialAccount, PtOrderPref, PtPayrollPayment, PtPayrollOtherPayment, PrtAgent, PrtChild, PrtContact, PrtCustomer, PrtEmployee, PrtFriend, PrtManager, PrtMember, PrtOrgRollup, PrtPartner, PrtRepresentative, PrtSalesAffiliate, PrtSpouse, PrtSupplier, WepTask, WepFix, WepNewFeature, WepFeatureEnhance, WepFeatureTest, WepToDo, WepDocument, WepCommunication, WepPlaceholder, WepPrOrgMgmt, WepPrTraining, WepPrItSecurity, WepPrMarketing, WepPrProdDev, WepPrProdFulfill, WepManufacturing, WepAssembling, WepRouting, WepRoutingTask, WepProductionRun, WepPickAssembly, WepShipmentShip, WepShipmentReceive, WepAssetUsage, WepBusinessTravel, WepMeeting, WepTraining, WepHoliday, WepMaintenance, WepResearch, WepDevelopment, WepSupport, WepDeployment, WepSubcontracting, WepPhoneCall, WepEmail, WepTimesheet, WerUnresolved, WerCompleted, WerIncomplete, WerWontComplete, WerDuplicate, WerCannotReproduce, WerInsufficient]
1 Like

When testing using the Service Run screen you should specify the parameters without the single quotes, i.e:

[PartyRelationshipType,WorkEffortPurpose,WorkEffortResolution,PaymentType,GeoType]

1 Like

@aabiabdallah you are an absolute lifesaver. Thank you!

1 Like