0

I am trying to set a service attribute's default value to null but I can't figure out how. Does anyone know if this is possible? Here is what I've tried so far:

Attempt 1

<service name="importGlAccounts" engine="java" location="com.hotwaxmedia.dsi.migration.MigrationServices" invoke="importGlAccounts" auth="true" transaction-timeout="14400">
    <attribute name="glNumb" mode="IN" type="String" optional="true" default-value="null"/>
</service>

Attempt 2

<service name="importGlAccounts" engine="java" location="com.hotwaxmedia.dsi.migration.MigrationServices" invoke="importGlAccounts" auth="true" transaction-timeout="14400">
    <attribute name="glNumb" mode="IN" type="String" optional="true" default-value="${groovy: null}"/>
</service>

Attempt 3

<service name="importGlAccounts" engine="java" location="com.hotwaxmedia.dsi.migration.MigrationServices" invoke="importGlAccounts" auth="true" transaction-timeout="14400">
    <attribute name="glNumb" mode="IN" type="String" optional="true" default-value=""/>
</service>

Attempt 4

<service name="importGlAccounts" engine="java" location="com.hotwaxmedia.dsi.migration.MigrationServices" invoke="importGlAccounts" auth="true" transaction-timeout="14400">
     <description>Import GL Accounts from Legacy Oracle.</description>
    <attribute name="glNumb" mode="IN" type="String" optional="true">
    <default-value>
        <null xsi:nil="true"/>
        </default-value>
    </attribute>
</service>
Vy Do
  • 46,709
  • 59
  • 215
  • 313
Minato
  • 21
  • 4

1 Answers1

0

You can set it in Java code.

Change

optional="true" default-value="null"

to

optional="true"

Then if..else in Java source code.

Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • The problem I am running into is that if no value is set then the framework passes the value from the last time the service was triggered, and the service itself has no way to know if the value is valid or if it is an old value that the framework passed in for some reason – Minato Apr 22 '21 at 11:54