cancel
Showing results for 
Search instead for 
Did you mean: 

Email not working?

dynamolalit
Champ on-the-rise
Champ on-the-rise
Hi,

I have created a pooled review workflow in alfresco using activiti 5.9.2 as below.


    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://activiti.org/bpmn20">
      <process id="TestactivitiReviewPooled" name="Test Pooled Review And Approve Process">
        <startEvent id="start" activiti:formKey="wf:submitGroupReviewTask"></startEvent>
        <userTask id="reviewTask" name="Review Task" activiti:candidateGroups="${bpm_groupAssignee.properties.authorityName}" activiti:formKey="wf:activitiReviewTask">
          <extensionElements>
            <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
              <activiti:field name="script">
                <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariable('bpm_dueDate', bpm_workflowDueDate);
                            if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;</activiti:string>
              </activiti:field>
            </activiti:taskListener>
            <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
              <activiti:field name="script">
                <activiti:string>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));</activiti:string>
              </activiti:field>
            </activiti:taskListener>
          </extensionElements>
        </userTask>
        <exclusiveGateway id="reviewDecision" name="Review Decision"></exclusiveGateway>
        <userTask id="approved" name="Document Approved" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:approvedTask">
          <documentation>
                    The document was reviewed and approved.
                </documentation>
          <extensionElements>
            <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
              <activiti:field name="script">
                <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                            if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;</activiti:string>
              </activiti:field>
            </activiti:taskListener>
            <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
              <activiti:field name="script">
                <activiti:string>execution.setVariable('bpm_assignee', person);
    </activiti:string>
              </activiti:field>
            </activiti:taskListener>
          </extensionElements>
        </userTask>
        <userTask id="rejected" name="Document Rejected" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:rejectedTask">
          <documentation>
                    The document was reviewed and rejected.
                </documentation>
          <extensionElements>
            <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
              <activiti:field name="script">
                <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                            if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;</activiti:string>
              </activiti:field>
            </activiti:taskListener>
            <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
              <activiti:field name="script">
                <activiti:string>execution.setVariable('bpm_assignee', person);</activiti:string>
              </activiti:field>
            </activiti:taskListener>
          </extensionElements>
        </userTask>
        <endEvent id="end"></endEvent>
        <sequenceFlow id="flow1" name="" sourceRef="start" targetRef="reviewTask"></sequenceFlow>
        <sequenceFlow id="flow3" name="" sourceRef="reviewDecision" targetRef="approved">
          <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome == 'Approve'}]]></conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="flow4" name="" sourceRef="reviewDecision" targetRef="rejected"></sequenceFlow>
        <sequenceFlow id="flow5" name="" sourceRef="approved" targetRef="end"></sequenceFlow>
        <sequenceFlow id="flow6" name="" sourceRef="rejected" targetRef="end"></sequenceFlow>

        <serviceTask id="alfrescoMailtask1" name="Alfresco Mail Task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
          <extensionElements>
            <activiti:field name="script">
              <activiti:string>var mail = actions.create("mail");
    mail.parameters.to = abc@abc.com;
    mail.parameters.subject = Test;
    mail.parameters.from = abc@abc.com;
    mail.parameters.text = Test123;
    mail.execute(bpm_package);
    </activiti:string>
            </activiti:field>
          </extensionElements>
        </serviceTask>

        <sequenceFlow id="flow7" name="to Alfresco Mail Task" sourceRef="reviewTask" targetRef="alfrescoMailtask1"></sequenceFlow>
        <sequenceFlow id="flow8" name="to Review Decision" sourceRef="alfrescoMailtask1" targetRef="reviewDecision"></sequenceFlow>
      </process>
      <bpmndi:BPMNDiagram id="BPMNDiagram_TestactivitiReviewPooled">
        <bpmndi:BPMNPlane bpmnElement="TestactivitiReviewPooled" id="BPMNPlane_TestactivitiReviewPooled">
          <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
            <omgdc:Bounds height="35" width="35" x="65" y="50"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNShape bpmnElement="reviewTask" id="BPMNShape_reviewTask">
            <omgdc:Bounds height="55" width="105" x="30" y="193"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNShape bpmnElement="reviewDecision" id="BPMNShape_reviewDecision">
            <omgdc:Bounds height="40" width="40" x="460" y="200"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNShape bpmnElement="approved" id="BPMNShape_approved">
            <omgdc:Bounds height="55" width="105" x="604" y="137"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected">
            <omgdc:Bounds height="55" width="105" x="604" y="254"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
            <omgdc:Bounds height="35" width="35" x="790" y="147"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNShape bpmnElement="alfrescoMailtask1" id="BPMNShape_alfrescoMailtask1">
            <omgdc:Bounds height="55" width="105" x="260" y="193"></omgdc:Bounds>
          </bpmndi:BPMNShape>
          <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
            <omgdi:waypoint x="82" y="85"></omgdi:waypoint>
            <omgdi:waypoint x="82" y="193"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
          <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
            <omgdi:waypoint x="480" y="200"></omgdi:waypoint>
            <omgdi:waypoint x="479" y="164"></omgdi:waypoint>
            <omgdi:waypoint x="604" y="164"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
          <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
            <omgdi:waypoint x="480" y="240"></omgdi:waypoint>
            <omgdi:waypoint x="479" y="281"></omgdi:waypoint>
            <omgdi:waypoint x="604" y="281"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
          <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
            <omgdi:waypoint x="709" y="164"></omgdi:waypoint>
            <omgdi:waypoint x="790" y="164"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
          <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
            <omgdi:waypoint x="709" y="281"></omgdi:waypoint>
            <omgdi:waypoint x="807" y="281"></omgdi:waypoint>
            <omgdi:waypoint x="807" y="182"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
          <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
            <omgdi:waypoint x="135" y="220"></omgdi:waypoint>
            <omgdi:waypoint x="260" y="220"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
          <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
            <omgdi:waypoint x="365" y="220"></omgdi:waypoint>
            <omgdi:waypoint x="460" y="220"></omgdi:waypoint>
          </bpmndi:BPMNEdge>
        </bpmndi:BPMNPlane>
      </bpmndi:BPMNDiagram>
    </definitions>

Now when i am trying to run it, i am getting below errors.


    May 30, 2012 5:15:27 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
       at org.apache.jsp.error500_jsp._jspService(error500_jsp.java:136)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
       at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421)
       at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
       at java.lang.Thread.run(Thread.java:662)
    May 30, 2012 5:15:27 PM org.apache.catalina.core.StandardHostValve custom
    SEVERE: Exception Processing ErrorPage[errorCode=500, location=/error500.jsp]
    org.apache.jasper.JasperException: java.lang.NullPointerException
       at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
       at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421)
       at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
       at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.NullPointerException
       at org.apache.jsp.error500_jsp._jspService(error500_jsp.java:136)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
       … 19 more

Any idea where i am going wrong?

Regards.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
I don't see any Activiti classes in that stacktrace…. ?

dynamolalit
Champ on-the-rise
Champ on-the-rise
Hi,

I am using this workflow inside alfresco.

Regards.

frederikherema1
Star Contributor
Star Contributor
Are you using activiti 5.9 in alfresco? Currently only 5.7 (5.7-alf branch) is supported.

Is this error thrown when starting the workflow in the Alfresco Explorer?
As Joram says, I don't see any alfresco/activiti related classes in the stacktrace. Seems like an error pretty deep in the JSP serving.