Skip to content

Commit

Permalink
Allow to skip arguments for mainInit in hid.Hydra class
Browse files Browse the repository at this point in the history
x
If you want call it manually but without performing all the same things like reading username/pass from ENV
  • Loading branch information
dolfinus committed Jan 6, 2020
1 parent 21e56db commit 83abbaf
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/org/camunda/latera/bss/connectors/hid/Hydra.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ class Hydra implements Ref, Message, DataType, AddParam, Good, Document, Contrac
this.resellerId = toIntSafe(execution.getVariable('hydraResellerId') ?: execution.getVariable('homsOrderDataResellerId'))
this.regionHierarchyOverride = execution.getVariable('regionHierarchy')

mainInit(
user : this.user,
password : this.password
)
mainInit()
setFirm()
this.version = getVersion()
}
Expand Down Expand Up @@ -135,23 +132,22 @@ class Hydra implements Ref, Message, DataType, AddParam, Good, Document, Contrac
return getRefIdByCode("LANG_${capitalize(langCode)}")
}

void mainInit(Map input) {
void mainInit(Map input = [:]) {
LinkedHashMap params = [
ip : '127.0.0.1',
user : null,
password : null,
appCode : 'NETSERV_HID',
user : this.user,
password : this.password,
app : 'NETSERV_HID',
appId : 'HydraOMS'
] + input

hid.execute('MAIN.INIT', [
vch_VC_IP : params.ip,
vch_VC_USER : params.user,
vch_VC_PASS : params.password,
vch_VC_APP_CODE : params.appCode,
vch_VC_CLN_APPID: params.appId
vch_VC_IP : params.ip,
vch_VC_USER : params.user,
vch_VC_PASS : params.password,
vch_VC_APP_CODE : params.app ?: params.appCode,
vch_VC_CLN_APPID : params.appId
])

}

void setFirm(def firmId = getFirmId()) {
Expand Down

0 comments on commit 83abbaf

Please sign in to comment.