2
1
0

Hi,

I am working on a collaboration service that uses multiple forms and I have set up a Job Delivery step setup to deliver after one of the steps. Currently this step is sending delivery emails using the delivery codes from both forms completed in previous steps.

I want to be able to specify which delivery code/form to use. For example;

User A completes Form A, then User B gets task for Form B, submits Form B and then delivery code Form B gets used and agency gets sent an email. Then later on User C will open Form A again, with additional areas visible, and complete Form A, and an email will be sent using Form A's delivery code.

Right now both Form A's and Form B's delivery codes will be used any time I try to configure a Delivery step. Is there a way to specify which form's delivery code/s to use?

Below is the JSON 'jobDefinition' from the service. In my editor the delivery step is at row 90.

{
  "jobDetails": {
    "name": "2StepCollab-Pat",
    "version": "4.0.6"
  },
  "properties": [
    { "name": "Task Form Code",  "value": "1185T" }
  ],
  "steps": [
    {
      "name": "Start",
      "type": "start",
      "actions": [
        {
          "name": "Handle Submission",
          "type": "Job Form Start",
          "properties": [
            { "name": "Process Message Text",  "value": "Your ${submission.formName} application is being processed." }
          ]
        }
      ],
      "routes": [
        { "name": "Default",  "nextStep": "Initial Review" }
      ]
    },
    {
      "name": "Initial Review",
      "type": "",
      "actions": [
        {
          "name": "Create Task",
          "type": "Job Task Assign",
          "properties": [
            { "name": "Task Form Code",  "value": "1162" },
            { "name": "Process Message Send Email",  "value": "true" },
            { "name": "Process Message Submission Step",  "value": "Start" },
            { "name": "Process Message Text",  "value": "Your ${submission.formName} application is at the Initial Review Step" },
            { "name": "Task Assign Group",  "value": "PatTest" },
            { "name": "Task Message",  "value": "Please perform the initial review of the ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}." },
            { "name": "Task Review Previous Step",  "value": "true" },
            { "name": "Task Subject",  "value": "Initial review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}" },
			{ "name": "Task Email Subject",  "value": "Initial review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}" },
			{ "name": "Task Email Message",  "value": "<html>
   <head>
      <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
   </head>
   <body style=\"background:#ececec; font-family:Arial,Helvetica,sans-serif;\">
    <center style=\"padding:1em;\">
         <table style=\"width:640px; border-collapse:collapse; color:black; background:white; text-align:left; font-family:Arial,Helvetica,sans-serif; padding:10px; font-size:14px\">
            <tr>
               <th style=\"color:white; background:#005596; text-align:left; padding:.5em;\" colspan=\"2\">
                  <h2>${submission.form.formName}</h2>
                  <h4>Form data summary</h4>
               </th>
            </tr>
		 <tr class=\"format\">
               <th width=\"25%\" style=\"text-align:left\">Submission ID</th>
               <td width=\"75%\">${submission.receiptNumber}</td>
            </tr>
            <tr class=\"format\">
               <th width=\"25%\" style=\"text-align:left\">Tracking number</th>
               <td width=\"75%\">${submission.trackingNumber}</td>
            </tr>
			 <tr class=\"format\">
				<td colspan=\"2\" align=\"center\">Initial review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}.<br> Please <a href=\"https://form.test.act.gov.au/maguire/secure/account/todo.htm\">login</a> to view the task and complete.</td>
			</tr>
         </table>
         <p>For issues or questions relating to SmartForms or Transaction Manger, please contact the Payment Services Integration Team on *7 5466.</p>
         <p>&nbsp;</p>
  </center>
   </body>
</html>"},
			{ "name": "Task Send Email",  "value": "true" }
          ]
        },
        {
          "name": "Handle Submission",
          "type": "Job Task Wait",
          "properties": [
            { "name": "Process Message Text",  "value": "Your ${submission.formName} application is being processed." }
          ]
        }
      ],
      "routes": [
        { "name": "Default",  "nextStep": "Deliver Submission" }
      ]
    },
    {
      "name": "Deliver Submission",
      "type": "",
      "actions": [
        {
          "name": "Trigger Submission Delivery Service",
          "type": "Job Delivery",
          "properties": [
            { "name": "Smartforms Delivery",  "value": "Smartforms Delivery" }
          ]
        }
      ],
      "routes": [
        { "name": "Default",  "nextStep": "Additional Review" }
      ]
    },
    {
      "name": "Additional Review",
      "type": "",
      "actions": [
        {
          "name": "Create Task",
          "type": "Job Task Assign",
          "properties": [
            { "name": "Process Message Submission Step",  "value": "Start" },
            { "name": "Process Message Text",  "value": "Your ${submission.formName} application is at the Final Review Step." },
            { "name": "Task Assign Group",  "value": "PatTest" },
            { "name": "Task Message",  "value": "The application has been initially approved and is pending your final review." },
            { "name": "Task Review Previous Step",  "value": "true" },
            { "name": "Task Subject",  "value": "Additional review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}" },
			{ "name": "Task Email Subject",  "value": "Initial review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}" },
			{ "name": "Task Email Message",  "value": "<html>
   <head>
      <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
   </head>
   <body style=\"background:#ececec; font-family:Arial,Helvetica,sans-serif;\">
    <center style=\"padding:1em;\">
         <table style=\"width:640px; border-collapse:collapse; color:black; background:white; text-align:left; font-family:Arial,Helvetica,sans-serif; padding:10px; font-size:14px\">
            <tr>
               <th style=\"color:white; background:#005596; text-align:left; padding:.5em;\" colspan=\"2\">
                  <h2>${submission.form.formName}</h2>
                  <h4>Form data summary</h4>
               </th>
            </tr>
		 <tr class=\"format\">
               <th width=\"25%\" style=\"text-align:left\">Submission ID</th>
               <td width=\"75%\">${submission.receiptNumber}</td>
            </tr>
            <tr class=\"format\">
               <th width=\"25%\" style=\"text-align:left\">Tracking number</th>
               <td width=\"75%\">${submission.trackingNumber}</td>
            </tr>
			 <tr class=\"format\">
				<td colspan=\"2\" align=\"center\">Final review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}.<br> Please <a href=\"https://form.test.act.gov.au/maguire/secure/account/todo.htm\">login</a> to view the task and complete.</td>
			</tr>
         </table>
         <p>For issues or questions relating to SmartForms or Transaction Manger, please contact the Payment Services Integration Team on *7 5466.</p>
         <p>&nbsp;</p>
  </center>
   </body>
</html>"},
			{ "name": "Task Send Email",  "value": "true" }
          ]
        },
        {
          "name": "Review Wait",
          "type": "Job Task Wait"
        }
      ],
      "routes": [
        { "name": "Default",  "nextStep": "Deliver notice" }
      ]
    },
    {
      "name": "Deliver notice",
      "type": "",
      "actions": [
        {
          "name": "Trigger Submission Delivery Service",
          "type": "Job Delivery",
          "properties": [
            { "name": "Smartforms Delivery",  "value": "Smartforms Delivery" }
          ]
        }
      ],
      "routes": [
        { "name": "Default",  "nextStep": "Application Delivery" }
      ]
    },
    {
      "name": "Application Delivery",
      "type": "",
      "actions": [
        {
          "name": "Application Delivery",
          "type": "Job Delivery"
        },
        {
          "name": "Application Delivery Wait",
          "type": "Job Delivery Wait"
        }
      ],
      "routes": [
        { "name": "Default",  "nextStep": "Application Completed" }
      ]
    },
    {
      "name": "Application Completed",
      "type": "endpoint",
      "actions": [
        {
          "name": "Process Message",
          "type": "Job Process Message",
          "properties": [
            { "name": "Process Message Send Email",  "value": "true" },
            { "name": "Process Message Submission Step",  "value": "Start" },
            { "name": "Process Message Text",  "value": "Thank you  has been Approved." }
          ]
        }
      ]
    }
  ]
}

Thanks,

Pat

    CommentAdd your comment...

    3 answers

    1.  
      2
      1
      0

      Hi Patrick,

      I have just ran a regression test this on 4.2 and 4.3 systems and it works.

      I believe that you might have a test environment that has 4.3 on it. I would suggest using that.

      I modified a 1 Step Review Job controller in which I am not delivering the initial submission.

       {
      "name": "Application Delivery",
      "type": "",
      "actions": [
      {
      "name": "Application Delivery",
      "type": "Job Delivery",
      "properties": [
               { "name": "Delivery Mode", "value": "Last Submission" }
      ]
      },
      {
      "name": "Application Delivery Wait",
      "type": "Job Delivery Wait"
      }
      ],
      "routes": [
      { "name": "Default", "nextStep": "Application Completed" }
      ]
      }

       

      As you can only the last submission was delivered. This came through in an email.

       

      Cheers

      Larry

       

      1. Patrick McPhan

        Hi Larry, I adapted this to my job controller and put it in our dev (4.3) system and it still doesn't seem to work. Could well be my error, however, we no longer need this functionality for the service I am working on. The form has been re-thought a bit and no longer requires this. If we have need help with this in the future we can just ask another question. Thanks for your help, Pat

      CommentAdd your comment...
    2.  
      2
      1
      0

      One more thing that I notice is that you have a lot of html template in you Job Definition JSON for "Task Email Message". This can be tidied up by moving this html into a Form Version property. The editor does better syntax highlighting for html. It makes your Job definition smaller.

       To do this

      • backup your current Job Definition.
      • copy the html into the form version property as per the image below. 
      • remove the "Task Email Message" action property.

      Again let me know if you have any issues.

      cheers

      Larry

        CommentAdd your comment...
      1.  
        2
        1
        0

        Hi Pat,

         

        In the Transact Javadoc API for the JobDeliveryService there is an action property "Delivery Mode" (highlighted in the screenshot below) that allows you to specify if you want to deliver "All Submissions" which is the default or only the "Last Submission".

        Normally the delivery channel used is mapped on a form by form basis and this is what is used. For example Form A is mapped to deliver via email, a different Form B is mapped to deliver via FTP. There is the ability to override the forms delivery channel by using the "Delivery Channell Name", allowing a delivery to go via a different channel to the one mapped in the form configuration. 

         

         

        To apply both to a step in your job you could do the following.

            {

              "name""Application Delivery",
              "type""",
              "actions": [
                {
                  "name""Application Delivery",
                  "type""Job Delivery"
                  "properties": [
                    { "name": "Delivery Channel Name", "value": "Customer Email Delivery" } ,
                             { "name": "Delivery Mode", "value": "Last Submission" } 
                  ]
                },
                {
                  "name""Application Delivery Wait",
                  "type""Job Delivery Wait"
                }
              ]

         

        Let me know if this solves your problem.

        Cheers

        Larry

        1. Patrick McPhan

          Hi Larry, Thanks for your quick response. I had previously tried using the Delivery Mode property without success but I tried again using your script and it still seems to deliver for both forms. I also tried changing some things with no success but I wasn't really sure what I was doing. Based on what you are saying I am assuming I don't need the 'Delivery Channel Name', because I want to use the delivery configured in the form, but only one of the forms at a time, rather than delivering both forms. Is there anything you can think of that I am doing wrong? Thanks, Pat

        2. Patrick McPhan

          I've also just been told that our delivery service is unique to us so I am not sure if this affects it.

        3. Patrick McPhan

          PPS. We are running TM 4.0 so that may also be a factor.

        CommentAdd your comment...