cancel
Showing results for 
Search instead for 
Did you mean: 

scheduled-action-services-context.xml for Java jobs

yerb
Champ in-the-making
Champ in-the-making
Hello,
I used the file "scheduled-action-services-context.xml" to schedule JavaScript jobs and it worked well. Now I wonder if I can use the same mechanism to schedule Java jobs (Java-backed web scripts for example). Is it possible ?
Thanks
7 REPLIES 7

hyperation
Champ on-the-rise
Champ on-the-rise
Hi yerb,

Can you provide some information on how to run a Javascript via scheduled action?

Thanks
Smiley Happy

zaizi
Champ in-the-making
Champ in-the-making

hyperation
Champ on-the-rise
Champ on-the-rise
Hi zaizi,

I actually checked the wiki and got it to work. But now I'm wondering if there is any example for Java-backed webscripts (running them as Scheduled Actions)?

Thanks
Smiley Happy

fracat71
Champ on-the-rise
Champ on-the-rise
Hi all,
if you are runnig Quartz example, do yuo know something of my problem: "Alfresco and Quartz using Jdbcjobstore"  …. http://forums.alfresco.com/en/viewtopic.php?f=9&t=26891

Thanks

yerb
Champ in-the-making
Champ in-the-making
Hi zaizi,

I actually checked the wiki and got it to work. But now I'm wondering if there is any example for Java-backed webscripts (running them as Scheduled Actions)?

Thanks
Smiley Happy

I gave up on the idea of calling a java-backed web script as scheduled actions. However, here is what I did (simple pseudocode):

I created an action executer, usable with "scheduled-action-services-context.xml".
public class MyActionExecuter extends ActionExecuterAbstractBase {

  public static final String NAME = "my-sample-executer";

  protected void executeImpl(final Action pAction, final NodeRef pActionedUponNodeRef) { … }

}
I declared this class in "actions-context.xml"
<bean id="my-sample-executer" class="MyActionExecuter" parent="action-executer" />
I created a web script calling my action executer.
public class MyWebScript extends AbstractCnpWebScript {

   protected Map<String, Object> executeImpl(final WebScriptRequest pRequest, final Status pStatus, final Cache pCache) {
    final NodeRef vNodeRef = null; // get the node ref instead
      final Action vAction = getActionService().createAction(MyActionExecuter.NAME);
      vAction.setTitle("Starting sample action");
      getActionService().executeAction(vAction, pTargetNodeRef);
      return null;
   }

}
I declared this class in "scripts-context.xml" (+ created files *.desc.xml and *.ftl)
<bean id="webscript.sample.get.myWebscript" class="MyWebScript" />
This way, the web script and the job do the same.

dafyddjames
Champ in-the-making
Champ in-the-making
Hi, I was hoping you could help me: I'm looking for the scheduled-action-services-context.xml file itself, I can't find it in my Alfresco installation. Do you know where I can get hold of it so I can create my own scheduled actions?

smartlead
Champ in-the-making
Champ in-the-making
Dear all,

I also used the scheduled-action-services-context.xml for the sample to kick of the chapter6-runScripAction, the scheduler seems running.
But the example, chapter6_publish_effective_content.js didn't get kick-off.

The stdout complains about the path
org.alfresco.error.AlfrescoRuntimeException: 09210001 Invalid store ref: Does not contain ://   //SpacesStore','lucene','PATH:"/app:company_home/app:dictionary/app:scripts at org.alfresco.service.cmr.repository.StoreRef.<init>(StoreRef.java:75)

I am using Alfresco 3.4
Can somebody help me on this?
Thanks !