« Indietro

Workflow in Action - Kaleo workflow context variables

Company Blogs 12 giugno 2012 Da Igor Beslic Staff

In this article I'll try to list workflow and service context content for some common asset types. You can use this information later when you build your notification templates or refer to it. When accessing variables I marked with "!" (like taskComments or transitionName) make sure they are present since its presence depends on workflow activity.

You will notice that I separated serviceContext since its keys depend on asset type.

Workflow context variables for WEB CONTENT
  KEY EXAMPLE VALUE CLASS
  companyId 10152 java.lang.String
  entryClassName com.liferay.portlet.journal.model.JournalArticle java.lang.String
  entryClassPK 11302 java.lang.String
  entryType Web Content java.lang.String
  groupId 10178 java.lang.String
! taskComments Comment somebody put when assigning... java.lang.String
! transitionName approve java.lang.String
  userId 10194 java.lang.String
  serviceContext content - obtain via key serviceContext
  articleId   java.lang.String
  articleURL LINK TO ARTICLE IN MAXIMIZED MODE java.lang.String
  assetLinkEntryIds   java.lang.String
  assetLinksSearchContainerPrimaryKeys   java.lang.String
  assetTagNames   java.lang.String
  autoArticleId true java.lang.String
  classNameId 0 java.lang.String
  classPK 0 java.lang.String
  content

This is my web content body....

java.lang.String
  defaultLanguageId en_US java.lang.String
  description_en_US   java.lang.String
  displayDateDay 11 java.lang.String
  displayDateHour 11 java.lang.String
  displayDateMinute 37 java.lang.String
  displayDateMonth 5 java.lang.String
  displayDateYear 2012 java.lang.String
  doAsGroupId 10178 java.lang.String
  folderId 0 java.lang.String
  indexable true java.lang.String
  indexableCheckbox on java.lang.String
  inputPermissionsShowOptions false java.lang.String
  inputPermissionsViewRole Guest java.lang.String
  languageId en_US java.lang.String
  localized true java.lang.String
  neverExpire true java.lang.String
  neverExpireCheckbox true java.lang.String
  neverReview true java.lang.String
  neverReviewCheckbox true java.lang.String
  refererPlid 10422 java.lang.String
  smallImage false java.lang.String
  smallImageURL   java.lang.String
  structureDescription   java.lang.String
  structureId   java.lang.String
  structureName Default java.lang.String
  structureXSD STRUCTURE XSD (removed to improve readability) java.lang.String
  templateId   java.lang.String
  title_en_US This is English title java.lang.String
  type general java.lang.String
  variableName content java.lang.String
  version 1.0 java.lang.String
  workflowAction 1 java.lang.String

 

Workflow context variables for BLOG ENTRY
  KEY EXAMPLE VALUE CLASS
  companyId 10152 java.lang.String
  entryClassName com.liferay.portlet.blogs.model.BlogsEntry java.lang.String
  entryClassPK 11329 java.lang.String
  entryType Blogs Entry java.lang.String
  groupId 10178 java.lang.String
! taskComments Comment somebody put when assigning... java.lang.String
! transitionName approve java.lang.String
  userId 10194 java.lang.String
  serviceContext content - obtain via key serviceContext
  assetLinkEntryIds   java.lang.String
  assetLinksSearchContainerPrimaryKeys   java.lang.String
  assetTagNames history,news,programming java.lang.String
  attachments   java.lang.String
  content

Always blog and share, and soon you'll get feedback!

java.lang.String
  description   java.lang.String
  displayDateAmPm 0 java.lang.String
  displayDateDay 12 java.lang.String
  displayDateHour 0 java.lang.String
  displayDateMinute 26 java.lang.String
  displayDateMonth 5 java.lang.String
  displayDateYear 2012 java.lang.String
  doAsGroupId 10178 java.lang.String
  editor

Always blog and share, and soon you'll get feedback!

java.lang.String
  entryId 11329 java.lang.String
  refererPlid 10422 java.lang.String
  smallImage false java.lang.String
  smallImageURL   java.lang.String
  title Today we blog... java.lang.String
  workflowAction 1 java.lang.String

 

Workflow context variables for MESSAGE BOARD MESSAGE
  KEY EXAMPLE VALUE CLASS
  companyId 10152 java.lang.String
  entryClassName com.liferay.portlet.messageboards.model.MBMessage java.lang.String
  entryClassPK 11362 java.lang.String
  entryType Message Boards Message java.lang.String
  groupId 10178 java.lang.String
! taskComments Comment somebody put when assigning... java.lang.String
! transitionName reject java.lang.String
  userId 10194 java.lang.String
  serviceContext content - obtain via key serviceContext
  anonymous false java.lang.String
  assetLinkEntryIds   java.lang.String
  assetLinksSearchContainerPrimaryKeys   java.lang.String
  assetTagNames sea, sailing,swimming java.lang.String
  attachments false java.lang.String
  body This is my question - give me answer! java.lang.String
  editor This is my question - give me answer! java.lang.String
  mbCategoryId 0 java.lang.String
  messageId 0 java.lang.String
  parentMessageId 0 java.lang.String
  preview false class java.lang.Boolean
  question false java.lang.String
  subject My MB Subject java.lang.String
  threadId 0 java.lang.String
  workflowAction 1 java.lang.String

 

Workflow context variables for DOCUMENT LIBRARY ENTRY
  KEY EXAMPLE VALUE CLASS
  entryClassName com.liferay.portlet.documentlibrary.model.DLFileEntry class java.lang.String
  groupId 10179 class java.lang.String
  entryType Documents and Media Document class java.lang.String
  event add class java.lang.String
  userId 10195 class java.lang.String
  taskComments   class java.lang.String
  companyId 10153 class java.lang.String
  entryClassPK 11802 class java.lang.String
  serviceContext content - obtain via key serviceContext
  p_p_auth xA64wzT5 class java.lang.String
  p_p_lifecycle 1 class java.lang.String
  referringPortletResource   class java.lang.String
  p_p_id 20 class java.lang.String
  assetLinksSearchContainerPrimaryKeys   class java.lang.String
  backURL   class java.lang.String
  formDate 1391035297271 class java.lang.String
  inputPermissionsViewRole Site Member class java.lang.String
  folderId 11701 class java.lang.String
  p_p_state maximized class java.lang.String
  title application for leave class java.lang.String
  uploadProgressId dlFileEntryUploadProgress class java.lang.String
  description application for leave class java.lang.String
  workflowAction 1 class java.lang.String
  fileEntryTypeId 0 class java.lang.String
  doAsGroupId 10179 class java.lang.String
  redirect http://localhost:8080/group/control_panel/manage?p_&p_p_modpandentdoAsGroupId=10179 class java.lang.String
  p_p_mode view class java.lang.String
  groupPermissions [Ljava.lang.String;@6a88faf5 class [Ljava.lang.String;
  inputPermissionsShowOptions false class java.lang.String
  p_l_id 10174 class java.lang.String
  uploader classic class java.lang.String
  repositoryId 10179 class java.lang.String
  fileEntryId 0 class java.lang.String
  cmd add class java.lang.String
  refererPlid 10182 class java.lang.String
  assetLinkEntryIds   class java.lang.String
  struts_action /document_library/edit_file_entry class java.lang.String
  assetTagNames   class java.lang.String
  p_v_l_s_g_id 0 class java.lang.String
For the purpose of readability of article I skipped some of serviceContext key-values since I don't find it interesting for templateing.

I'll update this blog entry for other asset types soon.

Commenti Autore Data
very useful, thanks! Daniele Baggio 12 giugno 2012 6.36
thanks for the infor Gowtham Mani 13 giugno 2012 0.30
very useful, thanks! Ákos Gábriel 2 luglio 2012 8.42
very useful, thanks, I'd be additionally be... Natasa Bulatovic 18 luglio 2012 14.38
[...] New Blog Entries: Cincinatti Film... Anonimo 22 agosto 2012 11.34
FYI these are now in the official docs:... James Falkner 8 novembre 2012 14.18
Very useful link, Can you please tell where can... sachin maheshwari 9 maggio 2013 2.22
Nice article. Link to official document is... Prasanta Bhuyan 28 gennaio 2014 5.57
[...] Hi, LR version 6.2 EE I have made... Anonimo 9 dicembre 2015 0.06
[...] Hi, Have a look on the blog. Hope it... Anonimo 29 aprile 2016 17.21
This is the link where you can find this... wolfgang kubens 10 novembre 2016 0.09

very useful, thanks!
Inviato il 12/06/12 6.36.
thanks for the infor
Inviato il 13/06/12 0.30.
very useful, thanks!
Inviato il 02/07/12 8.42.
very useful, thanks, I'd be additionally be interested in the context variables for Users and Organizations. Some of these would like to use in the workflow notification upon create user account i.e. the approver of the user account would like to have an email contining user first name, last name and email.

How to get these?
I tried context.firstName etc.. but no success so far.
Inviato il 18/07/12 14.38.
[...] New Blog Entries: Cincinatti Film Festival and Liferay, Custom Footer Navigation, Maven and GA2, 6.1 Development Guide, Liferay Open Development, Workflow Context Variables, and many more. Also, I... [...] Read More
Inviato il 22/08/12 11.34.
FYI these are now in the official docs: http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-­dgen08-designing-workflows-with-kaleo-designer-for-java-0
Inviato il 08/11/12 14.18.
Very useful link, Can you please tell where can be find all of these in code.
Inviato il 09/05/13 2.22.
Nice article. Link to official document is leading to the document index page though. I also see some properties are returned empty e.g. articleId for JournalArticle. Are those omissions deliberate?
Inviato il 28/01/14 5.57.
[...] Hi, LR version 6.2 EE I have made workflow for my custom entity, which is working fine. In one of the task I have to send User Notification to asset creator based on Transition. My Notification... [...] Read More
Inviato il 09/12/15 0.06.
[...] Hi, Have a look on the blog. Hope it helps. Regards Sign in to vote. Flag Please sign in to flag this as inappropriate. Mark as an Answer [...] Read More
Inviato il 29/04/16 17.21.
This is the link where you can find this helfpful overview in the liferay documentation:

https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/lev­eraging-template-editors-for-notifications
Inviato il 10/11/16 0.09.