This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,899 Users
  • 2,269,649 Discussions
  • 7,916,821 Comments

Discussions

Jython mapping script null values

Angelo Marino-Oracle
Angelo Marino-Oracle Member Posts: 34 Employee
edited May 23, 2017 5:07AM in Financial Data Management

Hi,

I am trying to convert the following into a Jython future-enabled script:

'If Len(trim(VarValues(23)))>0 then Result=VarValues(23) else Result="[None]" End If

this is the Jython script I created:

proc = fdmRow.getString("UD3")

if (len(proc) > 0):

  fdmResult = proc

else:

  fdmResult = "[None]"

but it does not work and I don't understand why...

We are on FDMEE 11.1.2.3 and importing data from file. The script is supposed to manage the automatic mapping of NULL fields in data records for a specific dimension.

Integration is targeting HFM.

Someone can help?

TX!

Tagged:
SH_INT

Best Answer

  • Francisco Amores
    Francisco Amores EPM Data Integration Specialist SPAINMember Posts: 1,694 Bronze Crown
    edited May 16, 2017 4:39AM Answer ✓

    That means: the type you are getting has no length.

    Probably getString("UD3") is returning null?

    Try this to see if helps:

    proc = fdmRow.getString("UD3")

    if (proc is not None and len(proc) > 0):

      fdmResult = proc

    else:

      fdmResult = "[None]"

    Also to determine the type you are getting:

    typeProc = type(proc)

    fdmAPI.logDebug("Type for proc var is: %s" % typeProc)

    SH_INT

Answers

  • SH_INT
    SH_INT Member Posts: 3,193 Bronze Crown
    edited May 11, 2017 4:38AM

    What exactly is going wrong / not working? Some additional information may be help others help you. On the face of it your code looks fine you have some unecessary enclosing brackets in the first line of your if satement but that shouldn't be causing a major issue

  • Angelo Marino-Oracle
    Angelo Marino-Oracle Member Posts: 34 Employee
    edited May 11, 2017 5:03AM

    I am trying to apply this into a very simple scenario:

    All mappings are explicit but the one on UD3;

    Only two records uploaded trhough file:

    Account;Entity;ICP;C1;C2;C3;C4;Amount

    3A1100;AD1;[ICP None];[None];[None];;[None];1000

    3A1100;AD1;[ICP None];[None];[None];D001;[None];2000

    as you can see the C3 in the first record is empty and it should be mapped to [None]

    in the second record instead I would expect D001 as target value.

    In the error log of FDMEE I find the following:

    2017-05-11 10:58:35,959 FATAL [AIF]: Error in 'Mapping Processi' (LIKE)

    Traceback (most recent call last):

      File "<string>", line 2074, in updateTDATASEG_T_TDATASEGW

      File "<string>", line 2, in <module>

    TypeError: len() of unsized object

    Please highlight me whether you need more information (complete log?).

    Many thanks!

  • Francisco Amores
    Francisco Amores EPM Data Integration Specialist SPAINMember Posts: 1,694 Bronze Crown
    edited May 16, 2017 4:39AM Answer ✓

    That means: the type you are getting has no length.

    Probably getString("UD3") is returning null?

    Try this to see if helps:

    proc = fdmRow.getString("UD3")

    if (proc is not None and len(proc) > 0):

      fdmResult = proc

    else:

      fdmResult = "[None]"

    Also to determine the type you are getting:

    typeProc = type(proc)

    fdmAPI.logDebug("Type for proc var is: %s" % typeProc)

    SH_INT
This discussion has been closed.