Upstream Relationships for a specific Item (velocity)
Options
Alex Wilson
Member Posts: 2
Hi all,
I am looking to collect a certain upstream item type, but can't seem to configure the function properly.
I have been using the below for Downstream Items and that works perfectly:
#foreach($h1 in $documentSource.getRelationshipsForDocumentAndType($InputRef.getId(),186,true))
## additional code here
#end
I am looking to collect a certain upstream item type, but can't seem to configure the function properly.
I have been using the below for Downstream Items and that works perfectly:
#foreach($h1 in $documentSource.getRelationshipsForDocumentAndType($InputRef.getId(),186,true))
## additional code here
#end
0
Comments
-
Hello Alex,
I normally use- $documentSource.getDownstreamDocumentIds()
- $documentSource.getUpstreamDocumentIds()
- $documentSource.getRelationshipBetweenDocuments()
Best,Alessandro
Systems Engineer
SICK AG0 -
Hi Alessandro, Do you mean something like the following?
#macro ($Function $InputRef $ListofDocs)
#foreach($upstreamDoc in $documentSource.getUpstreamDocumentIds($InputRef.getId()))
#if($186 == $documentSource.getDocumentTypeIdFromDocId(upstreamDoc .id)
#SuppressReturn($ListofDocs.add($upstreamDoc.getToDocument()))
#end
#end
#end
where:
#macro(SuppressReturn $command) #set($temp = $command) #end0 -
Hi Alex,
sorry for answering late, but now!
getUpstreamDocumentIds is returning an ID -> upstreamDoc.id won't work.
Just check the documentation -> Jama Software - Velocity engine
Best,
AlessandroAlessandro
Systems Engineer
SICK AG0