AnsweredAssumed Answered

Schedule job don´t work

Question asked by jjhinojosa on Jan 9, 2008
Hi, I´m trying to use a scheduled job. This is the beans that I write:

   <bean id="cambiaNombreAsunto" 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>
        <!– Find all nodes that do not have the aspect –>
        <property name="queryTemplate">
            <value>PATH:"/app:company_home/cm:REPARTO DE ASUNTOS/*"</value>
        </property>
        <property name="cronExpression">
            <value>0 15 19 9 1 ? *</value>
        </property>
        <property name="jobName">
            <value>jobA</value>
        </property>
        <property name="jobGroup">
            <value>jobGroup</value>
        </property>
        <property name="triggerName">
            <value>triggerA</value>
        </property>
        <property name="triggerGroup">
            <value>triggerGroup</value>
        </property>
        <!– Inject the scheduler - the trigger will be registered with this scheduler –>
        <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="cambiaNombreAsuntoAction"/>
        </property>
        <property name="transactionService">
            <ref bean="TransactionService"/>
        </property>
        <property name="runAsUser">
            <value>admin</value>
        </property>
    </bean>
   
   
   <bean id="cambiaNombreAsuntoAction" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition">
        <!– The name of the action. –>
        <!– In this case com.soluziona.alfresco.CambiaNombre –>
        <!– This is actually set in the bean configuration for this action in CSG-model-context.xml. –>
        <!– It is the bean name under which the action is registered in this file. –>
        <property name="actionName">
            <value>cambiaNombre</value>
        </property>
        <!– Define the properties required by the action. –>
        <property name="parameterTemplates">
            <map>
                <!– There is no easy way to get properties that can be set at the moment –>
                <!– You have to inspect the java code for the action implementation –>

                <!– Define the name of the aspact to add –>
                <entry>
                    <key>
                        <!– The name of the property –>
                        <!– This defines the name of the aspect –>
                        <value>nombAsunto</value>
                    </key>
                    <!– The aspect required for normal classification –>
                    <value>"Funciona"</value>
                </entry>

            </map>
        </property>

        <!– Required services and the freemarker template model –>
        <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>
   
   <bean id="cambiaNombre" class="com.soluziona.alfresco.CambiaNombre" parent="action-executer">
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
    </bean>
   
   <bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory">
        <property name="serviceRegistry">
            <ref bean="ServiceRegistry"/>
        </property>
    </bean>
, but never execute the action cambiaNombre. Can anyone say to me why don´t work this scheduled job?

Outcomes