Error Messages Improved

This commit is contained in:
Luis Fernando Molina committed 2019-11-16 09:27:01 +01:00
1 parent f1716bf250
commit 37ad57d4c7
1 file changed
+3
@@ -9,16 +9,19 @@ function newSessionFunctions () {
function runSession (node, functionLibraryProtocolNode, callBackFunction) {
/* We can not run a sessionif its parent process is not running. Less if it does not have a parent. */
if (node.payload.parentNode === undefined) {
node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be able to run.')
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
if (node.payload.parentNode.payload.uiObject.isRunning !== true) {
node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be running to be able to run.')
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
if (node.payload.referenceParent === undefined) {
node.payload.uiObject.setErrorMessage('Parent Process Instance need to reference a Process Definition.')
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}