Derived Columns with multiple return values

Diagramming issues

Moderator: Moderators

Derived Columns with multiple return values

Postby mvinca-tsi » Mon Jan 09, 2017 7:26 pm

I've setup a Generic Table where I have some derived columns. I have a derived column using Javascript that uses some variables passed into it that looks like this:

Code: Select all
var dirOut = null;
             
if (sourcePortTypeSet.contains( portEvaluating )) dirOut = outObject;       
if (targetPortTypeSet.contains( portEvaluating )) dirOut = inObject;

dirOut;


Is there a way I can return an array or a set so that if both if statement are true, I could return both objects to display in the cell of the table?
mvinca-tsi
Forum Newbie
Forum Newbie
 
Posts: 21
Posts Rating:0
Joined: Wed Apr 23, 2014 7:03 am
Full name: Michael Vinca

Re: Derived Columns with multiple return values

Postby paudzi » Tue Jan 17, 2017 2:18 am

Hello,

I don't know the syntax of the Javascript but theoretically it should be like this:

Code: Select all
var sourceContains = sourcePortTypeSet.contains( portEvaluating );
var targetContains = targetPortTypeSet.contains( portEvaluating );
var result = null;

if ( sourceContains && targetContains)
{
   result = [outObject, inObject];
}
else if ( sourceContains )
{
   result = outObject;
}
else if ( targetContains )
{
   result = inObject;
}
result;


With best regards,
No Magic Customer Support.
paudzi
Customer Support
Customer Support
 
Posts: 47
Posts Rating:4
Joined: Thu Oct 20, 2011 5:50 am


Return to Diagramming

Who is online

Users browsing this forum: No registered users and 1 guest