• Scripting execution CE 6.3.5 Dev not completing

  • 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.
 #45302  by silverspr
 
Hi jllort
In order to solve the document preview issue reported in an earlier post, I've had 99% success in compiling and converting to Dev 6.3.5. The only part that wasn't successful per the knowledge base instruction was the "scripting" execute described here: https://docs.openkm.com/kcenter/view/ok ... o-635.html

After pasting the code into the code window the Evaluate button did not update "to execute"....I tried running the code as Evaluate: there were no prompts/messages to indicate if the execution was successful or not.

thanks
dale
scripting execute
scripting execute
scripting.PNG (93.89 KiB) Viewed 4033 times
 #45308  by jllort
 
Really is shown in the bottom the execution time in green, that means the script has been executed. What is strange is the execution time does not take any milisecond. However this script only changes the mail of the crontab task, check if they have changed.
 #45315  by silverspr
 
HI jllort, thank you for your help.
I don't really know what I'm looking for in the crontab tasks. I can't tell what the script actually does?
Here are my crontab tasks listed currently. I do not have email enabled which might be part of the problem.
crontab tasks
crontab tasks
crontabOkM.PNG (29.48 KiB) Viewed 4027 times
thanks
 #45324  by jllort
 
The server is stopped for some reason at 00:00 ( backup ) ? might be the reason why never has been executed. What happens when you click on ray icon -> that should execute the cron task.
 #45327  by silverspr
 
hi, I'm not sure I follow why you think the server is stopped, but then you are the expert!
Nonetheless, when I click on the lightning bolt, the task executes. I've attached another snapshot of the tasks, you can see they all have today's date (Feb 15) which means the tasks have completed.
I reran the scripting execute, I don't see any change to the tasklist.
Feb 15 Crontasks
Feb 15 Crontasks
openkmcron2.PNG (29.86 KiB) Viewed 4018 times
thanks
 #45332  by jllort
 
The task is planned as @daily, that mean will be execute at 00:00 in your server, if the application is running. You can try to change the expression for this one "*/5 * * * *" and should be executed each minute. If the process is not executed each minuted then there's some issue ( consider that if process need more than 5 minutes to be completed the next will not be running until the first be finished ). That will help you to check if cron expression is working. In case is confirmed works, then I suspect the reason is that at you 00:00 the OpenKM might be not running, otherwise the process by cron will be started. The same will happens with "weekly" expression what is executed at 00:00
 #45335  by silverspr
 
Hi, ahhh ok now I see why you were thinking Cron wasn't running. The server does not run 24/7.
Cron is working, I tested by changing the Dashboard Activity Purge to */5 * * * * and it runs as expected.

My only question remaining: What task does the script create, so that I can check for it in Cron, is it already there? If so I presume its the mail task? If not then the script isn't working....which was where we started!

the script:
Code: Select all
import com.openkm.core.DatabaseException;
import com.openkm.dao.CronTabDAO;
import com.openkm.dao.bean.CronTab;

static final String MAIL = "noreply@openkm.com";
 
try {
     for (CronTab ct : CronTabDAO.findAll()) {
          if (ct.getMail().equals(MAIL)) {
               ct.setMail("");
               CronTabDAO.update(ct);
          }
     }
} catch (Exception e) {
    print("Exception: " + e);
} 
thanks
dale
 #45337  by jllort
 
I do not understanding the question:
What task does the script create, so that I can check for it in Cron, is it already there? If so I presume its the mail task? If not then the script isn't working....which was where we started!
 #45349  by jllort
 
The script it change all the mail address of the crontab tasks. If the mail address in the crontab task is set to "", then it means has been executed.
 #45356  by silverspr
 
HI, yes that makes sense after looking at the script again!
The mail column is empty in my cron tasks, see image posted earlier. Is the mail column in cron tasks the right place to look? I haven't set up email on this server does that make a difference.

thanks again
 #45362  by jllort
 
Yes this is the right column. That is a correction for previous OpenKM versions to remove default mail address and set to empty.

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.