Highlighted
Honored Contributor.
Honored Contributor.
414 views

flowdata fooey

I have a function designed to look into the result of a flowdata.getObject() method call and determine if a string is present. I get this when I try to use it:

<stackTrace xsi:type="xsd:string">com.novell.soa.af.impl.soap.AdminException={_Reason=Process id [cn=snCreate,cn=RequestDefs,cn=AppConfig,cn=User Application Driver,cn=driverset1,o=system], version [28]: Dataitem [MAP0] source expression [function () {x="Country";if (flowdataIndexOf(flowdata.getObject('start/request_form/clearAttr'),x) != -1) {return flowdata.get('IDVault/'+x)} else {return ""}}] does not support expressions of type: flowdata.foo}

I've gotten that before when trying to pass the flowdata object itself as a parameter but not when trying to pass the DOM which comes out of getObject(). is this some sort of validation gone horribly awry?

code follows

function flowdataIndexOf(listObj,value)
{
msg("flowdataIndexOf("+value+")");
for ( var j=0; j < listObj.size(); j++)
{

if ( listObj.get(j).getFirstChild() == null ) continue;

var listValue = listObj.get(j).getFirstChild().getNodeValue();
if (listValue.toLowerCase() == value.toLowerCase())
{
print(":)"+value + "=="+ listValue+"?");

return j.toString();
}
else
{

print(":|"+value + "=="+ listValue+"?");
}
};
print (":(")
return "-1";
}



function ()
{x="Country";
if (flowdataIndexOf(flowdata.getObject('start/request_form/clearAttr'),x) != -1)
{return flowdata.get('IDVault/'+x)}
else
{return ""}}
Labels (1)
0 Likes
2 Replies
Honored Contributor.
Honored Contributor.

Re: flowdata fooey

So the answer is that in fact this is a bug in how the workflow evaluates the ecma. I replaced

function ()
{x="Country";
if (flowdataIndexOf(flowdata.getObject('start/request_form/clearAttr'),x) != -1)
{return flowdata.get('IDVault/'+x)}
else
{return ""}}

with this

function ()
{x="Country"; o=flowdataIndexOf(flowdata.getObject('start/request_form/clearAttr');
if (o,x) != -1)
{return flowdata.get('IDVault/'+x)}
else
{return ""}}

which is logically equivalent but IDM misinterprets the former as invalid while the latter works like a charm. So my code was correct but IDM didn't see in that way. Yet another mine to sidestep. Would mind less if I could search/replace the PRD as a whole but I had to update 24 separate data items in one mapping activity. But you should really be able to use flowdata like any other ecmascript object and pass it into a function.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: flowdata fooey

I have ran into the flowdata.foo error you're describing and I found that it happened when I was using the characters "flowdata" within my ecma for strings, comments, functions, variables. I would stay away from that. As a result I started using "flwdata" instead in naming when needed, and I haven't seen the error since.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.