Page 1 of 1

Defining methods in automation script

PostPosted:Tue Apr 20, 2021 10:11 am
by MohamadAli
Hi,

I saw in scripting example (scripting example) that we can define a method and call it to recursively traverse a repository.

I want to do the same but in automation scripting, however, I get an error that I am calling an undefined method. Is it possible to do such thing in automation?

Thanks in advance

Re: Defining methods in automation script

PostPosted:Sat Apr 24, 2021 8:13 am
by jllort
This script should working with small changes in automation script, the scripting engine is exactly the same. I suggest using classes either scripting that's more confortable for debug and control of error than scripting ( https://docs.openkm.com/kcenter/view/ok ... ction.html ) . Anyway you can add a try catch to capture the error and log it with StackTraceUtils and FileLogger
* https://docs.openkm.com/kcenter/view/ok ... html#error
* https://docs.openkm.com/kcenter/view/ok ... /strong%3E

Then will be clear what kind of error you are getting.

Re: Defining methods in automation script

PostPosted:Mon May 31, 2021 3:25 am
by mayaharlan
I have exactly the same problem.

Re: Defining methods in automation script

PostPosted:Mon May 31, 2021 10:38 am
by MohamadAli
I ended up creating a workflow, and executing it from automation, and it worked