• Defining methods in automation script

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #52287  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
 #52308  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.