diff options
| -rw-r--r-- | src/main/resources/cristal-function-lib.xql | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/resources/cristal-function-lib.xql b/src/main/resources/cristal-function-lib.xql index 273727f..3c6b6b3 100644 --- a/src/main/resources/cristal-function-lib.xql +++ b/src/main/resources/cristal-function-lib.xql @@ -13,4 +13,21 @@ declare function cristal:getCollByType($typeName as xs:string) as xs:string* let $prodType := collection($itemColl)/Property[@name="Type"]
where $prop eq $typeName and $prodType eq "Product"
return $itemColl
+};
+
+declare function cristal:getCollByName($name 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
+};
+
+declare function cristal:getOutcomeFromEvent($coll as xs:string, $event as node()) as xs:string
+{
+ let $schemaName := $event/@SchemaName
+ let $schemaVersion := $event/@SchemaVersion
+ let $eventId := $event/@ID
+ return fn:string-join(($coll,'/','Outcome.',$schemaName,'.',$schemaVersion,'.',$eventId),'')
};
\ No newline at end of file |
