AnsweredAssumed Answered

Problème alfresco 3.2 Envoi de mail apres un timer

Question asked by leyer on Dec 29, 2009
Latest reply on Mar 19, 2010 by leyer
Bonjour alors voici mon problème,
Je veux envoyer un email de notification au terme d'un timer.
Le timer fonctionne bien mais a son terme j'ai des erreurs incohérente.


16:01:42,286 User:boreal2 ERROR [graph.def.GraphElement] action threw exception: 11290109 Failed to execute supplied script: il manque ';' avant une instruction (AlfrescoJS#1)
org.alfresco.scripts.ScriptException: 11290109 Failed to execute supplied script: il manque ';' avant une instruction (AlfrescoJS#1)
        at org.alfresco.repo.jscript.RhinoScriptProcessor.executeString(RhinoScriptProcessor.java:254)
        at org.alfresco.repo.processor.ScriptServiceImpl.executeScriptString(ScriptServiceImpl.java:314)
        at org.alfresco.repo.processor.ScriptServiceImpl.executeScriptString(ScriptServiceImpl.java:292)
        at sun.reflect.GeneratedMethodAccessor393.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy192.executeScriptString(Unknown Source)
        at org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript.executeScript(AlfrescoJavaScript.java:178)
        at org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript.execute(AlfrescoJavaScript.java:132)
        at org.jbpm.graph.def.Action.execute(Action.java:129)
        at sun.reflect.GeneratedMethodAccessor388.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$3ded12e7.execute(<generated>)
        at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:284)
        at sun.reflect.GeneratedMethodAccessor383.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.taskmgmt.def.Task$$EnhancerByCGLIB$$68ae2200.executeAction(<generated>)
        at org.jbpm.job.Timer.execute(Timer.java:59)
        at org.alfresco.repo.workflow.jbpm.AlfrescoTimer.access$001(AlfrescoTimer.java:43)
        at org.alfresco.repo.workflow.jbpm.AlfrescoTimer$1.doWork(AlfrescoTimer.java:92)
        at org.alfresco.repo.workflow.jbpm.AlfrescoTimer$1.doWork(AlfrescoTimer.java:90)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:514)
        at org.alfresco.repo.workflow.jbpm.AlfrescoTimer.execute(AlfrescoTimer.java:87)
        at sun.reflect.GeneratedMethodAccessor380.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.job.Job$$EnhancerByCGLIB$$568ffd96.execute(<generated>)
        at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:166)
        at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread.access$201(AlfrescoJobExecutorThread.java:43)
        at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread$TransactionJob.execute(AlfrescoJobExecutorThread.java:138)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:327)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:234)
        at org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutorThread.executeJob(AlfrescoJobExecutorThread.java:113)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
Caused by: org.mozilla.javascript.EvaluatorException: il manque ';' avant une instruction (AlfrescoJS#1)
        at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
        at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
        at org.mozilla.javascript.Parser.addError(Parser.java:140)
        at org.mozilla.javascript.Parser.reportError(Parser.java:154)
        at org.mozilla.javascript.Parser.statementHelper(Parser.java:1225)
        at org.mozilla.javascript.Parser.statement(Parser.java:655)
        at org.mozilla.javascript.Parser.statements(Parser.java:603)
        at org.mozilla.javascript.Parser.statementHelper(Parser.java:1107)
        at org.mozilla.javascript.Parser.statement(Parser.java:655)
        at org.mozilla.javascript.Parser.parse(Parser.java:377)
        at org.mozilla.javascript.Parser.parse(Parser.java:315)
        at org.mozilla.javascript.Context.compileImpl(Context.java:2320)
        at org.mozilla.javascript.Context.compileString(Context.java:1348)
        at org.mozilla.javascript.Context.compileString(Context.java:1337)
        at org.alfresco.repo.jscript.RhinoScriptProcessor.executeString(RhinoScriptProcessor.java:244)

<timer name="sendNotification" duedate="1 minutes" repeat="1 minutes">
   <action name="sendNotification" class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
      <script>
      {
         var mail = actions.create("mail");
         mail.parameters.to = "test@test.com";
         mail.parameters.subject = "Timer is working!!!";
         mail.parameters.from = "alfresco@alfresco.com";
         mail.parameters.text = "some text, in case template is not found";
          mail.execute(bpm_package);
      }
      </script>
   </action>
</timer>

Outcomes