Defining methods in automation script

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
MohamadAli
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: Wed Mar 31, 2021 10:34 am

Defining methods in automation script

Post 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
jllort
Moderator
Moderator
Posts: 11512
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Defining methods in automation script

Post 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.
mayaharlan
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Mon May 31, 2021 3:11 am

Re: Defining methods in automation script

Post by mayaharlan »

I have exactly the same problem.
MohamadAli
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: Wed Mar 31, 2021 10:34 am

Re: Defining methods in automation script

Post by MohamadAli »

I ended up creating a workflow, and executing it from automation, and it worked
Post Reply