summaryrefslogtreecommitdiff
path: root/src/main/resources/cristal-function-lib.xql
blob: 3fd719d8a521164d29e43602ecb7bdb7bb56fb78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
declare function local:getOutcomeFromView($coll as xs:string, $view as node()) as xs:string
{ 
    let $schemaName := $view/@SchemaName
    let $schemaVersion := $view/@SchemaVersion
    let $eventId := $view/@Last
    return fn:string-join(($coll,'/','Outcome.',$schemaName,'.',$schemaVersion,'.',$eventId),'') 
};

declare function local:getCollByType($typeName as xs:string) as xs:string*
{
    for $prop in //Property[@name="CfCName"]
    let $itemColl := util:collection-name($prop)
    let $prodType := collection($itemColl)/Property[@name="Type"]
    where $prop eq $typeName and $prodType eq "Product"
    return $itemColl
};