I have created a script which should signal a workflow to the next step. This works in our test-environment, but the same script fails at a customer. I receive the following error message when I try to execute it: transaction has already been marked for rollback. When I refresh the UI, nothing has changed. When I signal the workflow in the UI, it works.
Could you please tell me what I'm doing wrong?
My script: <javascript> logger.log("Starting…"); var zaakId = args["zaakId"]; logger.log("Argument zaakId = " + zaakId); var defs = workflow.getLatestDefinitions(); for (var a in defs){ var b = defs[a]; var instances = b.getActiveInstances(); logger.log("Description:" + b.getDescription() + " Name:" + b.getName() + " Title:" + b.getTitle()); for each(w in instances){ logger.log("instance found:" + w.getDescription()); var paths = w.getPaths(); for (j = 0; j < paths.length; j++){ var path = paths[j]; var node = path.getNode(); var tasks = path.getTasks(); for (i = 0; i < tasks.length; i++){ var task = tasks; var desc = task.getDescription(); logger.log("Task.description:" + desc + " Task.name:" + task.getName() + " Task.title:" + task.getTitle()); var taskProps = task.getProperties(); if (taskProps["{http://www.alfresco.org/model/bpm/1.0}description"].search(zaakId)!= -1){ logger.log("Taak gevonden"); var trans = task.getTransitions(); for (var k in trans){ logger.log("Key is:" + k + ", value is:" + trans[k]); try { path.signal(k); } catch(exception){ logger.log(exception.message); } break; } } } } } } </javascript>