Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.4K Intelligent Advisor
- 75 Insurance
- 537.7K On-Premises Infrastructure
- 138.7K Analytics Software
- 38.6K Application Development Software
- 6.1K Cloud Platform
- 109.6K Database Software
- 17.6K Enterprise Manager
- 8.8K Hardware
- 71.3K Infrastructure Software
- 105.4K Integration
- 41.6K Security Software
Jython mapping script null values

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!
Best 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)
Answers
-
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
-
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!
-
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)