<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Access to Session Attributes from Workflow</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118605463" />
  <subtitle>Access to Session Attributes from Workflow</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118605463</id>
  <updated>2026-04-04T23:25:29Z</updated>
  <dc:date>2026-04-04T23:25:29Z</dc:date>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118608351" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118608351</id>
    <updated>2020-02-27T15:58:14Z</updated>
    <published>2020-02-27T15:58:14Z</published>
    <summary type="html">Thanks for the answer.&lt;br /&gt;I&amp;#39;ve had a list of sites that are shown in every navigation if an expando value matches a fixed value.This list is updated in a portlet which changes the value of this site expando, and it should be updated too with the portlet. A job inserts in database all the sites which have this expando value and the user which has a certain role in the site, and when the user is logged in, it is stored in session the list with the sites only for that user. &lt;br /&gt;This is why I want to do it with a parameter session, because I can&amp;#39;t imagine another way to do it. Database access in every navigation is not possible because it makes the portal too slow. The solution that I&amp;#39;m trying to implement is valid in terms of  performance.&lt;br /&gt;Regards.</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2020-02-27T15:58:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118609301" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118609301</id>
    <updated>2020-02-27T15:50:29Z</updated>
    <published>2020-02-27T15:50:29Z</published>
    <summary type="html">That&amp;#39;s because workflow scripts are&lt;em&gt; not tied to a HttpRequest &lt;/em&gt;- they can be triggered by API calls, e.g. timer based, when there&amp;#39;s simply no person signed in to the portal &lt;em&gt;at all&lt;/em&gt;. &lt;br /&gt;We might be able to help you if you let us know the problem you&amp;#39;re trying to solve. And no, &amp;#34;comparing session attributes with something&amp;#34; doesn&amp;#39;t count as a problem. Use Business Terms: What are the requirements, what is the story, that you&amp;#39;re trying to implement?</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2020-02-27T15:50:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118604900" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118604900</id>
    <updated>2020-02-27T13:35:00Z</updated>
    <published>2020-02-27T13:35:00Z</published>
    <summary type="html">Thanks, but this option is not possible for me because I have to compare this attribute in navigations so has to be stored in session.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tried  also this: PortalSessionThreadLocal.getHttpSession();&lt;br /&gt;but it does not work neither.&lt;br /&gt;&lt;br /&gt;Regards</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2020-02-27T13:35:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118606909" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118606909</id>
    <updated>2020-02-27T11:30:24Z</updated>
    <published>2020-02-27T11:30:24Z</published>
    <summary type="html">Simplest  way  is you  persist this information in Database  and then  retrieve , update etc  </summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-02-27T11:30:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118606563" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118606563</id>
    <updated>2020-02-27T10:48:05Z</updated>
    <published>2020-02-27T10:48:05Z</published>
    <summary type="html">Thanks both of you.I have a custom parameter which store a list of ids. This list is modified in a portlet and should be modified with this workflow too. So I can&amp;#39;t pass it when the workflow starts because it could be modified by the portlet. Morevoer, I need to store again the value in session when executing the workflow, so I need to access to this parameter during the task, for getting the value and for storing it again.&lt;br /&gt;Any ideas?&lt;br /&gt;&lt;br /&gt;​​​​​​​Thanks again!</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2020-02-27T10:48:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118604150" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118604150</id>
    <updated>2020-02-27T10:30:41Z</updated>
    <published>2020-02-27T10:30:41Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Daniel G:&lt;/div&gt;&lt;blockquote&gt; I want to access to the attributes that are stored in session when a workflow task is executed. I&amp;#39;ve tried many things but I&amp;#39;m not able to do it.&lt;br /&gt;&lt;/blockquote&gt;A workflow might run outside of any request, thus there&amp;#39;s no request available. &lt;em&gt;What kind&lt;/em&gt; of data are you looking for, to solve &lt;em&gt;which&lt;/em&gt; problem?</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2020-02-27T10:30:41Z</dc:date>
  </entry>
  <entry>
    <title>RE: Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118606195" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118606195</id>
    <updated>2020-02-27T10:22:22Z</updated>
    <published>2020-02-27T10:22:22Z</published>
    <summary type="html">Hi, Are you looking for some  particular  data from session object  while executing workflow task ? You can rather store that data/object in servicecontext while initiating the workflow and use it while executing task.</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-02-27T10:22:22Z</dc:date>
  </entry>
  <entry>
    <title>Access to Session Attributes from Workflow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118605462" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118605462</id>
    <updated>2020-02-27T09:01:12Z</updated>
    <published>2020-02-27T09:01:12Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi.&lt;br&gt;I want to access to the attributes that are stored in session when a workflow task is executed. I've tried many things but I'm not able to do it.&lt;pre&gt;&lt;code&gt;HttpServletRequest httpServletRequest = serviceContext.getRequest();&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; HttpSession httpSession = httpServletRequest.getSession();
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; List&amp;lt;long&amp;gt;gruposCarencia= ( List&amp;lt;long&amp;gt;)httpSession.getAttribute("LIFERAY_SHARED_GruposCarencia");
&amp;lt;/long&amp;gt;&amp;lt;/long&amp;gt;&lt;/code&gt;&lt;/pre&gt;This is always null because serviceContext.getRequest() is null.&lt;br&gt;Could anyone help me? Thanks in advance!&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2020-02-27T09:01:12Z</dc:date>
  </entry>
</feed>
