Flow designer error: Transaction cancelled

Gabriel_EY
Tera Contributor

I created a Subflow which creates a determinate number of tasks in the RITM, based on a Catalog variable. The Subflow is called by a script that pass the number of tasks that need to be created.

 

The problem is that if the number of tasks is greater than something like 150 tasks, show the following error in Flow log: “Flow Designer: Operation(item.{...}.Create Catalog Task) failed with error: com.glide.sys.TransactionCancelledException: Transaction cancelled”

 

I’m sure that is not an infinite loop problem, because if it creates 60, 70… 100 tasks, the Subflow works fine.

Another important thing. If use the button test of Flow Designer, the Subflow works, even if I create 300 or 400 tasks.

 

Something that I noticed, is that the Subflow is canceled after 30 seconds, instead of 60 seconds or more like the test that I do in Flow Designer test button.

 

Could someone help me? Thanks!

3 REPLIES 3

Gabriel_EY
Tera Contributor

PS: The error in Flow Log

Flow Designer: Operation(item.580cfebf87ba5d90f9fd31980cbb3513.1c0cfebf87ba5d90f9fd31980cbb3506.f351fd0e73141300612c273ffff6a7c8.Create Catalog Task) failed with error: com.glide.sys.TransactionCancelledException: Transaction cancelled
at com.glide.sys.Transaction.cancelIfRequested0(Transaction.java:1670)
at com.glide.sys.Transaction.cancelIfNecessary(Transaction.java:2064)
at com.glide.db.DBIError.handleException(DBIError.java:28)
at com.glide.db.DBI.executeStatement(DBI.java:1260)
at com.glide.db.DBQueryExecutor.executeStatement(DBQueryExecutor.java:339)
at com.glide.db.DBQueryExecutor.executeStatement(DBQueryExecutor.java:327)
at com.glide.db.DBQueryExecutor.execute(DBQueryExecutor.java:68)
at com.glide.db.DBQuery.executeAsResultSet0(DBQuery.java:372)
at com.glide.db.DBQuery.executeAndReturnTable(DBQuery.java:349)
at com.glide.db.DBAction.executeNormal(DBAction.java:302)
at com.glide.db.DBAction.executeAndReturnException(DBAction.java:256)
at com.glide.db.RDBMSQueryContext.executeQuery(RDBMSQueryContext.java:42)
at com.glide.db.DBQuery.execute(DBQuery.java:2996)
at com.glide.db.array.DBArray.query(DBArray.java:103)
at com.glide.db.meta.FieldArray.loadArray(FieldArray.java:22)
at com.glide.script.GlideElement.ensureArray(GlideElement.java:1373)
at com.glide.script.GlideElement.toString(GlideElement.java:1828)
at com.glide.script.GlideRecord.getValue(GlideRecord.java:7152)
at com.glideapp.servicecatalog.ItemOptionsQuestionSet.newVariableSetContainer(ItemOptionsQuestionSet.java:260)
at com.glideapp.servicecatalog.ItemOptionsQuestionSet.prep(ItemOptionsQuestionSet.java:227)
at com.glideapp.questionset.ContainerAwareQuestionSet.load(ContainerAwareQuestionSet.java:49)
at com.glideapp.servicecatalog.variables.VariablePoolQuestionSet.load(VariablePoolQuestionSet.java:40)
at com.glide.vars2.GlideElementVariables.getVariablePoolQuestions(GlideElementVariables.java:562)
at com.glide.vars2.GlideElementVariables.loadVariablePoolQuestions(GlideElementVariables.java:524)
at com.glide.vars2.GlideElementVariables.loadCatalogVariables(GlideElementVariables.java:480)
at com.glide.vars2.GlideElementVariables.createVariablePool(GlideElementVariables.java:315)
at com.glide.vars2.GlideElementVariables.ensurePool(GlideElementVariables.java:669)
at com.glide.vars2.GlideElementVariables.get(GlideElementVariables.java:675)
at com.glide.script.fencing.WrappedScriptableObject.get(WrappedScriptableObject.java:43)
at com.glide.script.fencing.ScopedGlideElement.get(ScopedGlideElement.java:47)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:2318)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1529)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1522)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1271)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)
at com.glide.caller.gen.sys_script_a6e94bba87eb41d04b68a7983cbb356e_script.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)
at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1518)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$exec$1(InterpretedFunction.java:168)
at com.glide.caller.gen.sys_script_a6e94bba87eb41d04b68a7983cbb356e_script.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:167)
at com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:354)
at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:177)
at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:111)
at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:322)
at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:226)
at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:213)
at com.glide.script.BusinessRule.runScript(BusinessRule.java:443)
at com.glide.script.BusinessRule.runSyncBusinessRule(BusinessRule.java:325)
at com.glide.script.BusinessRule.runBusinessRule(BusinessRule.java:218)
at com.glide.script.BusinessRule.run(BusinessRule.java:194)
at com.glide.script.GlideRecordBusinessRules.run(GlideRecordBusinessRules.java:264)
at com.glide.script.GlideRecord.runScripts(GlideRecord.java:1422)
at com.glide.script.GlideRecord.runScriptsAndEngines(GlideRecord.java:1356)
at com.glide.script.GlideRecord.insert(GlideRecord.java:5032)
at com.glide.script.GlideRecord.insert(GlideRecord.java:4962)
at com.snc.process_flow.operation.CreateCatalogTaskOperation.run(CreateCatalogTaskOperation.java:37)
at com.snc.process_flow.engine.Operation.execute(Operation.java:208)
at com.snc.process_flow.engine.ProcessEngine.executeOps(ProcessEngine.java:548)
at com.snc.process_flow.engine.ProcessEngine.runInternal(ProcessEngine.java:457)
at com.snc.process_flow.engine.ProcessEngine.run(ProcessEngine.java:444)
at com.snc.process_flow.engine.ProcessEngine.callBlock(ProcessEngine.java:220)
at com.snc.process_flow.engine.CallBlockOperation.callBlock(CallBlockOperation.java:93)
at com.snc.process_flow.engine.CallBlockOperation.run(CallBlockOperation.java:68)
at com.snc.process_flow.engine.Operation.execute(Operation.java:208)
at com.snc.process_flow.engine.ProcessEngine.executeOps(ProcessEngine.java:548)
at com.snc.process_flow.engine.ProcessEngine.runInternal(ProcessEngine.java:457)
at com.snc.process_flow.engine.ProcessEngine.run(ProcessEngine.java:444)
at com.snc.process_flow.engine.ProcessAutomation.run(ProcessAutomation.java:77)
at com.snc.process_flow.engine.GlideProcessAutomation.runSync(GlideProcessAutomation.java:139)
at com.snc.process_flow.engine.GlideProcessAutomation.runWithDomain(GlideProcessAutomation.java:253)
at com.snc.process_flow.engine.GlideProcessAutomation.lambda$runAsUserSync$1(GlideProcessAutomation.java:222)
at com.snc.process_flow.engine.PFSessionClone.run(PFSessionClone.java:70)
at com.snc.process_flow.engine.GlidePFSession.runPlanAsUserSession(GlidePFSession.java:42)
at com.snc.process_flow.engine.GlideProcessAutomation.runAsUserSync(GlideProcessAutomation.java:220)
at com.snc.process_flow.engine.GlideProcessAutomation.messageFlow(GlideProcessAutomation.java:308)
at com.snc.process_flow.engine.GlideProcessAutomation.messageFlow(GlideProcessAutomation.java:278)
at com.snc.process_flow.engine.GlideProcessAutomation._start(GlideProcessAutomation.java:508)
at com.snc.process_flow.engine.GlideProcessAutomation.access$200(GlideProcessAutomation.java:90)
at com.snc.process_flow.engine.GlideProcessAutomation$StartBuilder.start(GlideProcessAutomation.java:1186)
at com.glide.plan.runners.FlowObjectExecutor.startFlowObjectSynchronously(FlowObjectExecutor.java:245)
at com.glide.plan.runners.FlowObjectExecutor.executeToCompletion(FlowObjectExecutor.java:122)
at com.glide.plan.runners.FlowObjectExecutor.executeInternalWithResponse(FlowObjectExecutor.java:112)
at com.glide.plan.runners.FlowObjectExecutor.lambda$executeWithResponse$0(FlowObjectExecutor.java:57)
at com.glide.sys.Transaction.executeWithTimeout(Transaction.java:3096)
at com.glide.plan.runners.FlowObjectExecutor.executeWithResponse(FlowObjectExecutor.java:57)
at com.glide.plan.runners.FlowObjectAPI.executeWithResponse(FlowObjectAPI.java:60)
at com.glide.plan.runners.scriptable.ScriptableFlowRunner.jsFunction_run(ScriptableFlowRunner.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:670)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:614)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2609)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1518)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)
at com.glide.caller.gen.Call_subflow_to_create_tasks___advanced_script.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)
at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1518)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$exec$1(InterpretedFunction.java:168)
at com.glide.caller.gen.Call_subflow_to_create_tasks___advanced_script.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:167)
at com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:354)
at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:177)
at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:111)
at com.glideapp.workflow.WorkflowScopedScriptRunner.evaluateAndSetAnswer(WorkflowScopedScriptRunner.java:218)
at com.glideapp.workflow.WorkflowScopedScriptRunner.evaluateWithinScope(WorkflowScopedScriptRunner.java:161)
at com.glideapp.workflow.WorkflowScopedScriptRunner.evaluateString(WorkflowScopedScriptRunner.java:89)
at com.glideapp.workflow.queue.activity.Workflow.jsFunction_evaluateString(Workflow.java:855)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:670)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:614)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2609)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1518)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)
at com.glide.caller.gen._refname_.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)
at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)
at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:2658)
at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:2630)
at com.glide.script.RhinoObject.callFunction(RhinoObject.java:169)
at com.glide.script.GlideRhinoObject.callFunction(GlideRhinoObject.java:156)
at com.glideapp.workflow.WorkflowScopedScriptRunner.callFunction(WorkflowScopedScriptRunner.java:813)
at com.glideapp.workflow.WorkflowScopedScriptRunner.callFunction(WorkflowScopedScriptRunner.java:795)
at com.glideapp.workflow.element.providers.LegacyActivityProvider.handleEvent(LegacyActivityProvider.java:262)
at com.glideapp.workflow.element.ExecutingActivity.handleEvent(ExecutingActivity.java:69)
at com.glideapp.workflow.queue.activity.ActivityManager.runActivity(ActivityManager.java:339)
at com.glideapp.workflow.queue.activity.ActivityManager.runActivities(ActivityManager.java:265)
at com.glideapp.workflow.queue.activity.ActivityManager.processCommand(ActivityManager.java:161)
at com.glideapp.workflow.queue.command.ActiveCommandQueueDelegate.signal(ActiveCommandQueueDelegate.java:97)
at com.glideapp.workflow.queue.command.ActiveCommandQueueDelegate.processCommand(ActiveCommandQueueDelegate.java:62)
at com.glideapp.workflow.queue.command.CommandManager$CommandQueue.processCommand(CommandManager.java:367)
at com.glideapp.workflow.queue.command.CommandManager.queue(CommandManager.java:135)
at com.glideapp.workflow.WorkflowScriptAPI.jsFunction_broadcastEvent(WorkflowScriptAPI.java:226)
at com.glideapp.workflow.WorkflowScriptAPI.jsFunction_broadcastEventToCurrentsContexts(WorkflowScriptAPI.java:242)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:670)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:614)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2609)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen.sys_script_include_d3669766c0a8016901828e92d1202ac5_script_99._c_anonymous_19(sys_script_include.d3669766c0a8016901828e92d1202ac5.script:279)
at org.mozilla.javascript.gen.sys_script_include_d3669766c0a8016901828e92d1202ac5_script_99.call(sys_script_include.d3669766c0a8016901828e92d1202ac5.script)
at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen.sys_script_include_0360b36d0a0a0b260a89dfec60c339c4_script_258._c_anonymous_51(sys_script_include.0360b36d0a0a0b260a89dfec60c339c4.script:844)
at org.mozilla.javascript.gen.sys_script_include_0360b36d0a0a0b260a89dfec60c339c4_script_258.call(sys_script_include.0360b36d0a0a0b260a89dfec60c339c4.script)
at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1518)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)
at com.glide.caller.gen.sys_script_070a46fe0a0a0b260555062b357f0a83_script.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)
at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)
at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1518)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:830)
at org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)
at com.glide.caller.gen.sys_script_070a46fe0a0a0b260555062b357f0a83_script.call(Unknown Source)
at com.glide.script.ScriptCaller.call(ScriptCaller.java:18)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3459)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:164)
at com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:354)
at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:177)
at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:111)
at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:322)
at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:226)
at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:213)
at com.glide.script.BusinessRule.runScript(BusinessRule.java:443)
at com.glide.script.BusinessRule.runSyncBusinessRule(BusinessRule.java:325)
at com.glide.script.BusinessRule.runBusinessRule(BusinessRule.java:218)
at com.glide.script.BusinessRule.run(BusinessRule.java:194)
at com.glide.script.GlideRecordBusinessRules.run(GlideRecordBusinessRules.java:264)
at com.glide.script.GlideRecord.runScripts(GlideRecord.java:1422)
at com.glide.script.GlideRecord.runScriptsAndEngines(GlideRecord.java:1356)
at com.glide.script.GlideRecord.postChange(GlideRecord.java:5172)
at com.glide.script.GlideRecord.postUpdate(GlideRecord.java:5140)
at com.glide.script.GlideRecord.updateWithoutResettingOperation(GlideRecord.java:4682)
at com.glide.script.GlideRecord.update(GlideRecord.java:4576)
at com.glide.script.GlideRecord.update(GlideRecord.java:4495)
at com.glide.ui_list_edit.ListEditSaver.update(ListEditSaver.java:199)
at com.glide.ui_list_edit.ListEditSaver.save(ListEditSaver.java:91)
at com.glide.ui_list_edit.ListEditSet.process(ListEditSet.java:32)
at com.glide.ui_list_edit.AJAXListEdit.process(AJAXListEdit.java:43)
at com.glide.processors.XMLHttpProcessor.processJavaAJAX(XMLHttpProcessor.java:168)
at com.glide.processors.XMLHttpProcessor.process(XMLHttpProcessor.java:121)
at com.glide.processors.AProcessor.runProcessor(AProcessor.java:612)
at com.glide.processors.AProcessor.processTransaction(AProcessor.java:274)
at com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:184)
at com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:172)
at com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:46)
at com.glide.sys.Transaction.run(Transaction.java:2488)
at com.glide.ui.HTTPTransaction.run(HTTPTransaction.java:27)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.glide.db.TransactionSQLCancelledException
at com.glide.db.QueryTimer.<init>(QueryTimer.java:38)
at com.glide.db.pool.PooledDBI.createQueryTimer(PooledDBI.java:266)
at com.glide.db.DBI.executeStatement(DBI.java:1234)
... 221 more

How you resolved this issue, we are facing same issue

Kiera
Tera Expert

Appreciate this is an old issue now but just in case anyone sees this - the issue here is that you're triggering your subflow from a script. When executing a flow manually using the sn_fd.FlowAPI.executeSubflow() method etc. it will time out after 30 seconds (30000 ms) which is the default value in the com.glide.hub.flow_api.default_execution_time system property.

 

You can override this default timeout by passing a timeout parameter at the end of your method e.g.

sn_fd.FlowAPI.executeSubflow('flow_name', inputs, '600000');
 
Alternatively, you can change the value in the com.glide.hub.flow_api.default_execution_time system property.