Skip to content

Commit

Permalink
Do a case insensitive equality check for entity name when creating an…
Browse files Browse the repository at this point in the history
…d running flows , if it returns more than one result, revert to strict check. (#1868)
  • Loading branch information
srinathgit authored and aebadirad committed Feb 12, 2019
1 parent 7501eeb commit 94f1ee4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,28 @@ declare function flow:get-flow-nocache(
{

hul:run-in-modules(function() {
/hub:flow[
hub:entity = $entity-name and
let $flow := /hub:flow[
fn:lower-case(hub:entity) = fn:lower-case($entity-name) and
hub:name = $flow-name]
[
[
if (fn:exists($flow-type)) then
hub:type = $flow-type
else
fn:true()
]
return
if ((fn:count($flow)) > 1) then
/hub:flow[
hub:entity = $entity-name and
hub:name = $flow-name]
[
if (fn:exists($flow-type)) then
hub:type = $flow-type
else
fn:true()
]
]
else
$flow
}) ! hul:deep-copy(.)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ declare function hent:get-model($entity-name as xs:string)

declare function hent:get-model($entity-name as xs:string, $used-models as xs:string*)
{
let $model := fn:collection($ENTITY-MODEL-COLLECTION)[info/title = $entity-name]
let $model :=
let $_ := fn:collection($ENTITY-MODEL-COLLECTION)[lower-case(info/title) = lower-case($entity-name)]
return
if (fn:count($_) > 1) then
fn:collection($ENTITY-MODEL-COLLECTION)[info/title = $entity-name]
else
$_
where fn:exists($model)
return
let $model-map as map:map? := $model
Expand Down

0 comments on commit 94f1ee4

Please sign in to comment.