Workflow for content not able to get content Title

Mohamed Saleem, modified 6 Years ago. Junior Member Posts: 40 Join Date: 12/16/15 Recent Posts

Hi,

 I am using single approver workflow only. But I changed the notification message as my custom message, 

I am not able to get content title.

 

    <template>
                    <![CDATA[${title} was transmitted for review by ${userName}]]>
    </template>

 

${entryType}  -  Web Content 

${userName} -  Test Test

 

 

I want title - Title of the content

 I tried with groovy script also, its not working

 

If anyone knows please help me?

Mohamed Saleem, modified 6 Years ago. Junior Member Posts: 40 Join Date: 12/16/15 Recent Posts

Hi Amos, 

 Thanks for reply

 

Using ServiceLocator I get the page title. by using the workflow context object.

Use below code in definition xml

<#assign LayoutArticleLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")/>

<#assign plId = serviceContext.plid/>

<#assign attributes = serviceContext.getAttributes()/>

<#assign lang = serviceContext.languageId/>

<#assign layoutservice = LayoutArticleLocalService.fetchLayout(plId)/>

<#assign title = layoutservice.getName(lang)/>

 

${title}