AnsweredAssumed Answered

Schedule Action throws Null Pointer Exception

Question asked by landerigeno on Sep 14, 2009
Hello:
I want to execute a schedule action to delete documents with tagged aspect but it thows a Null Pointer Exception or  "No Nodes Selected".
I have to send the NodeRef parameter to the Action Bean or to the js? I'm been reading a lot of post but no one have the same problem and I think the code is OK
Thank You in advance
I post the code
<bean id="findtag" 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>archive://SpacesStore</value>
            </list>
        </property>
             <property name="queryTemplate">
           <value>+ASPECT:"{http://www.alfresco.org/model/system/1.0}tagged"</value>
        </property>
        <property name="cronExpression">
       <value>* */5 * * * ?</value>
        </property>
        <property name="jobName">
            <value>joby</value>
        </property>
        <property name="jobGroup">
            <value>jobGroupy</value>
        </property>
        <property name="triggerName">
            <value>triggery</value>
        </property>
        <property name="triggerGroup">
            <value>triggerGroupy</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="delete"/>
        </property>
        <property name="transactionService">
            <ref bean="TransactionService"/>
        </property>
        <property name="runAsUser">
            <value>admin</value>
        </property>
    </bean>

    <bean id="delete" 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:diccionario_de_datos/app:scripts/cm:delete.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>
delete.js is just one line:
document.remove();

Outcomes