Passing data from anonymous user to Logged in user with non persistent entity?

0
So for the first challange. A user clicks on a deeplink url, which takes the user to an item page. The item page has a log in prompt.   My idea was:  write the GUID to memory. step 2 would be on login of User, fire a microflow to check if there is anything in the entity “InMemory” There is retrieve from association, from database, but not retrieve from memory :(  how can I solve this?  
asked
3 answers
2

Hello Jason,

That is not possible with non persistent objects because those only live client side. But why doing it the hard way? If a deeplink is only for non anonymous users Mendix already does the hard part. You homepage only needs to be a microflow that checks if there is a pending link before opening the regular homepage. So somebody clicks the deeplink. Deeplinks sees that the user needs to be logged in and shows the login page. Homepage microflow is triggered sees that there is a pending link and execute that one instead of going to the home page.

Regards,

Ronald

 

answered
2

Jason,

As Ronald said, if you are trying to Deeplink in with a login challenge to the user before they get to the Item page, the Deeplink module will handle that one out of the box.

If you are trying to show the item page to the user anonymously and then, when they click the login link, pass in the item id, I think you can do that as follows:

  • deeplink to anonymous item page will enable navigation to that page
  • on anonymous item page, create a second deeplink to an item page that requires login.  In this deeplink, put the item id as a url argument. 
  • Note that you’ll need to configure the deeplink to accept arguments when you create it and set up the microflow that the deeplink calls with a single parameter

Hope that helps,

Mike

answered
2

As I mentioned in a comment, the Java API does have an option when initializing a new session to copy data from the old session by providing the old session ID:

https://apidocs.rnd.mendix.com/9/runtime/com/mendix/core/Core.html#initializeSession(com.mendix.systemwideinterfaces.core.IUser,java.lang.String)

Would require some Java to whip up a test.

answered