How to retrieve CurrentSession in a microflow?

0
I have a Datagrid 2 that displays "Item" objects. On the same page I have a data view linked to a non-persistable entity "Counter", that represents a total amount of "Items" with specific attribute values. I need to update the "Counter" anytime when I change any "Item" and refresh it on the page. How can I do this?   I associated Counter with Current Session, hoping that I can retrieve Current Session and get Counter by association. But the question is - how can I retrieve CurrentSession in a microflow?   UPD: I ended up associating it to a current User. But I'm curious, is there a better solution?
asked
1 answers
1

Maxim,

 

You can retrieve System.Session with either xpath:

 

[System.Session_User = $currentUser]

or

[id = $currentSession]

 

I would be careful associating anything to the session or current user as it can affect performance because associated data doesn't get garbage collected, avoid if possible or keep to minimum. https://www.mendix.com/blog/the-art-of-state-part-2-garbage-collection/#4-how-does-garbage-collection-work 

 

 

answered