2 Replies Latest reply on Dec 29, 2008 6:59 AM by Rohan Suryadevara

    template attribute of mail node

    betul aydin Newbie

      Hi
      I want to use template in mail node but I couldnt be successfull.
      I added jbpm.mail.templates.xml this template:

      
      <mail-templates>
      
       <variable name="BaseTaskListURL" value="http://b0101:8080/jbpm-console/sa/task.jsf?id=" />
      
       <mail-template name='task-assign'>
       .....................................................
       </mail-template>
      
       <mail-template name='ekbilgi'>
       <actors>#{taskInstance.actorId}</actors>
       <subject>Seyahat talep formu '#{taskInstance.name}'</subject>
       <text><![CDATA[
       Tarfınızdan #{atarih} tarihinde yollanan seyahat talep isteği eksik bilgi girişi nedeni ile geri gönderilmiştir.Tekrar talep girişi için aşağıdaki linki tıklayınız.
       #{BaseTaskListURL}#{taskInstance.id}
       İyi Çalışmalar
       ]]></text>
       </mail-template>
      
      </mail-templates>
      
      

      and in my jbpm ÄŸproject I added this code in task node for send mail.
      
      <task-node name="EkBilgi">
       <task name="Ek Bilgi Talebi">
       <controller>
      .............................................
       </controller>
      
       </task>
       <transition to="insanKaynaklari" name="tekrarTalep"></transition>
       <event type="node-enter">
       <mail name="ekbilgi" template="jbpm.mail.templates.xml" actors="#{kim}" subject="Seyahat Talebi Ek Bilgi" text="![CDATA[Tarfınızdan #{atarih} tarihinde
       yollanan seyahat talep isteÄŸi red edilmiÅŸtir
       Ayrıntılı bilgi için İnsan Kaynaklarını arayın.]]">
      
      
       </mail>
       </event>
       </task-node>

      and I have got this. error:
      
      ERROR [GraphElement] action threw exception: null
      java.lang.NullPointerException
       at org.jbpm.mail.Mail.send(Mail.java:144)
       at org.jbpm.mail.Mail.execute(Mail.java:81)
       at org.jbpm.graph.def.Action.execute(Action.java:122)
       at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:259)
       at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:215)
       at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:185)
       at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:169)
       at org.jbpm.graph.def.Node.enter(Node.java:302)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
       at org.jbpm.graph.def.Node_$$_javassist_49.enter(Node_$$_javassist_49.java)
       at org.jbpm.graph.def.Transition.take(Transition.java:151)
       at org.jbpm.graph.def.Node.leave(Node.java:393)
       at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
       at org.jbpm.graph.def.Node_$$_javassist_49.leave(Node_$$_javassist_49.java)
       at org.jbpm.graph.exe.Token.signal(Token.java:192)
       at org.jbpm.graph.exe.Token.signal(Token.java:163)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
       at org.jbpm.graph.exe.Token_$$_javassist_64.signal(Token_$$_javassist_64.java)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:482)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:421)
       at org.jbpm.jsf.core.action.CompleteTaskActionListener.handleAction(CompleteTaskActionListener.java:52)
       at org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction(JbpmActionListenerWrapper.java:82)
       at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
       at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760)
       at javax.faces.component.UICommand.broadcast(UICommand.java:372)
       at org.jbpm.jsf.taskform.ui.UITaskFormButtonBase.broadcast(UITaskFormButtonBase.java:56)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
       at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
       at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
       at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Unknown Source)
      
      

      How can I send mail with mail template?