cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduled actions in 3.3 community

bende
Champ in-the-making
Champ in-the-making
I updated my alfresco from 3.2 to 3.3 (Community Edition). I defined a scheduled action in scheduled-action-services-context.xml. The action works fine with v3.2 but in v3.3 i got an error: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.error.AlfrescoRuntimeException: 03220001 Invalid store ref: Does not contain ://   //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts]

This is my scheduled-action-services-context.xml file:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   
    <!–
    Define the model factory used to generate object models suitable for use with freemarker templates.
    –>
    <bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory">
        <property name="serviceRegistry">
            <ref bean="ServiceRegistry"/>
        </property>
    </bean>


<!–
    Execute the script /Company Home/Record Management/testscript.js
    –>
    <bean id="runScriptAction" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition">
        <property name="actionName">
            <value>script</value>
        </property>
        <property name="parameterTemplates">
            <map>
                <entry>
                    <key>
                        <value>script-ref</value>
                    </key>
                    <value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:subfolderer_async.js"' )}</value>
                </entry>
            </map>
        </property>
        <property name="templateActionModelFactory">
            <ref bean="templateActionModelFactory"/>
        </property>
        <property name="dictionaryService">
            <ref bean="DictionaryService"/>
        </property>
        <property name="actionService">
            <ref bean="ActionService"/>
        </property>
        <property name="templateService">
            <ref bean="TemplateService"/>
        </property>
    </bean>
   
    <!–
   Run the script every minute - select the single node company home that is not used …
    –>
    <bean id="runScript" class="org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition">
        <property name="transactionMode">
            <value>UNTIL_FIRST_FAILURE</value>
        </property>
        <property name="compensatingActionMode">
            <value>IGNORE</value>
        </property>
        <property name="searchService">
            <ref bean="SearchService"/>
        </property>
        <property name="templateService">
            <ref bean="TemplateService"/>
        </property>
        <property name="queryLanguage">
            <value>lucene</value>
        </property>
        <property name="stores">
            <list>
                <value>workspace://SpacesStore</value>
            </list>
        </property>
        <property name="queryTemplate">
            <value>+PATH:"/app:company_home/st:sites//cm:documentLibrary/cm:Feldolgozás/*" -@cm\:name:"Törlésre"</value>
        </property>
        <property name="cronExpression">
            <value>0 0/10 * * * ?</value>
        </property>
        <property name="jobName">
            <value>jobD</value>
        </property>
        <property name="jobGroup">
            <value>jobGroup</value>
        </property>
        <property name="triggerName">
            <value>triggerD</value>
        </property>
        <property name="triggerGroup">
            <value>triggerGroup</value>
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory"/>
        </property>
        <property name="actionService">
            <ref bean="ActionService"/>
        </property>
        <property name="templateActionModelFactory">
            <ref bean="templateActionModelFactory"/>
        </property>
        <property name="templateActionDefinition">
            <ref bean="runScriptAction"/> <!– This is name of the action (bean) that gets run –>
        </property>
        <property name="transactionService">
            <ref bean="TransactionService"/>
        </property>
        <property name="runAsUser">
            <value>System</value>
        </property>
    </bean>
   
   
</beans>

This is a bug or something is wrong in the definition?
4 REPLIES 4

ingdade
Champ in-the-making
Champ in-the-making
I have the same problem. Someone solved it?

Please Help!

drndivoje
Champ in-the-making
Champ in-the-making
I have the same problem and really don't know how to solve it. If someone knows please post it.

drndivoje
Champ in-the-making
Champ in-the-making

razvanb
Champ in-the-making
Champ in-the-making
Hello,
I receive the same error too.
Is there other way to make reference for a node without using the 'selectSingleNode' which seems to cause the problem?
What if I want to refer a script outside the repository, how can I give a value for script-ref?

Regards, Razvan