call nanoflow with param different from context

Hi everyone, There is a new api in to call nanoflow. Supposed i create a new non-persistant mxObject and want to call a nanoflow which accepts the object as param. How could I do this with the new Api? Should I create a new MxContext and set context to it before call the nanoflow?  Suppose I have a list, does the nanoflow support it? Best regards,
1 answers


That is a very good question indeed.  I would expect that it is possible to do the call with a single object at least, if not with a list. But it does seem like it is not possible. Also, creating a new context seems to be discouraged "This class should never be instantiated manually." as the Mendix docs clearly states.
A possible workaround might be to always associate new objects that you create to the object in context and then do a retrieve by association in the nano-flow.


Perhaps you can try the following trick: Change the current context, call the nano-flow and then restore the original context;

var prev_entity = context.getTrackEntity();
var prev_id = context.getTrackId();
context.setContext("NewEntity", newObjectGuid);

context.setContext(prev_entity , prev_id);