Skip to content

Commit

Permalink
Merge branch 'master' into HCX-54
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Mar 5, 2020
2 parents 1ab6bb6 + e40f5fd commit 3e13612
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ v1.4.2 [unreleased]
- [#42](https://github.com/latera/camunda-ext/pull/42) Fix MailSender usage without auth
- [#29](https://github.com/latera/camunda-ext/pull/29) Fix calling changePassword in net serv access put methods
- [#47](https://github.com/latera/camunda-ext/pull/47) Fix hid.Hydra#tagify method
- [#2239604](https://github.com/latera/camunda-ext/commit/2239604) Fix hid.Hydra#mergeParams method
- [#46](https://github.com/latera/camunda-ext/pull/46) Fix hid.Hydra#deleteEntityAddress method

v1.4.1 [2020-02-14]
Expand Down
27 changes: 21 additions & 6 deletions src/org/camunda/latera/bss/connectors/hid/Hydra.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,28 @@ class Hydra implements Ref, Message, DataType, AddParam, Good, Document, Contrac
if (params.containsKey(noIdName) && params[noIdName] != null) { // addressTypeId: ..., addressType: 'ADDR_TYPE_IP', excluding addressType: null
if (isMap(params[noIdName])) { //addrType: [in: ...]
Map where = params[noIdName]
['in', 'not in'].each { CharSequence operator ->
['in', 'not in', '=', '!='].each { CharSequence operator ->
// addressTypeId: ..., addressType: [in: ['ADDR_TYPE_IP', 'ADDR_TYPE_IP6'], 'not in': ['ADDR_TYPE_Subnet']]
if (where.containsKey(operator) && isList(where[operator])) {
List newWhere = []
where[operator].each { CharSequence code ->
newWhere << getRefIdByCode(code) // -> addressTypeId: [in: [123, 456], 'not in': [789]]
if (where.containsKey(operator)) {
if (isList(where[operator])) {
List newWhere = []
where[operator].each { def val ->
def newVal = null
if (isString(val)) { //addressType: [in: ['ADDR_TYPE_IP'], ...]
newVal = getRefIdByCode(val) // -> addressTypeId: [in: [123, 456], 'not in': [789]]
}
if (newVal == null) { //addressType: [in: [123], ...]
newVal = val // -> addressTypeId: [in: [123], ...] without any changes
}
newWhere << newVal
}
where[operator] = newWhere
} else if (isString(where[operator])) { //addressType: ['!=': 'ADDR_TYPE_IP']
def newVal = getRefIdByCode(where[operator])
if (newVal != null) {
where[operator] = newVal // -> addressTypeId: ['!=': 123]
}
}
where[operator] = newWhere
}
} // overwise addressType: [like: 'A%'] -> addressTypeId: [like: 'A%']
result[name] = where
Expand All @@ -97,6 +111,7 @@ class Hydra implements Ref, Message, DataType, AddParam, Good, Document, Contrac
}
}
}

//And then remove non-id key if id was set above
params.each{ CharSequence name, def value ->
if (!keysToExclude.contains(name)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,7 @@ trait Address {
}

Map getEntityAddress(def entityOrEntityTypeId, def entityAddressId) {
Boolean isSubj = isSubject(entityOrEntityTypeId)

if (isSubj) {
if (isSubject(entityOrEntityTypeId)) {
return getSubjAddress(entityAddressId)
} else {
return getObjAddress(entityAddressId)
Expand Down

0 comments on commit 3e13612

Please sign in to comment.