Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-39086

New feature - Allow variables to be used in the notification subject line of Kaleo workflow definitions (solution is included)

    Details

      Description

      In a Kaleo workflow definition, you can have email notifications.

      Currently, you can have variables in the body of the email notification, but you can not add variables to the subject/description field of an email notification.

      It is a simple change to allow variables in the subject/description field for email notifications of workflow definition. Paul Shemansky contributed this while working on workflow definitions for Liferay Foundation.

      In plugins / webs / kaleo-web / docroot / WEB-INF / src / com / liferay / portal / workflow / kaleo / runtime / notification / NotificationUtil.java, replace:

      -    String notificationSubject = kaleoNotification.getDescription();
      

      with the following lines:

      +    String notificationSubject =
      +      notificationMessageGenerator.generateMessage(
      +        kaleoNotification.getKaleoClassName(),
      +        kaleoNotification.getKaleoClassPK(),
      +        kaleoNotification.getName(),
      +        kaleoNotification.getTemplateLanguage(),
      +        kaleoNotification.getDescription(), executionContext);
      

      and then now, you can do something like this in your workflow definition:

             <notification>
               <name>request-rejected-notification</name>
      +        <description><![CDATA[<#assign context = serviceContext.getAttribute("context")>${context.GRANT_TYPE} Request Rejected]]></description>
               <template>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mark.jin Mark Jin (Inactive)
              Reporter:
              scott.lee Scott Lee
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 24 weeks, 5 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M5