$currentSession but for Nanoflow

I would like to have an NPE linked to my current session, NPE's live in memory, nanoflows run in memory, but current session live in the server, what is the memory/client version of this?   or am I miss understanding concepts? 
1 answers

You are right about that current session lives on the backend server. But I thought about couple of workarounds:

Option 1:

From your Nanoflow Just call a microflow, that returns the current session object. But if this activity is ocurring very often, then it’s not the best solution.


Option 2:

If your app has mandatory login in (users can only interact with it after login) then you can do the following.

Customize the  logging workflow to return the currentSession object and from there on, keep it in memory on the frontEnd.
This is restrictive, since the currentSession object will not get updated and it requires mandatory login.

Option :

  1. Make an Abstract Markup Entity which you can use as an Interface, named ‘Content’. It will have no properties.  
  2. All the entities that are usually returned by the backend will  be generalizations of ‘Content’
  3. New Entity called ‘Response’
    - Property 1 : Content entity
    - Property 2: Session entity
  4. Make all the workflows return the new Response entity and in it always add their usual returned entity (which is now marked as generalizaiton of Response entity)  + the CurrentSession object