diff options
| -rw-r--r-- | src/main/resources/cristal-function-lib.xql | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/resources/cristal-function-lib.xql b/src/main/resources/cristal-function-lib.xql new file mode 100644 index 0000000..3fd719d --- /dev/null +++ b/src/main/resources/cristal-function-lib.xql @@ -0,0 +1,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
+};
\ No newline at end of file |
