Let StudioPro auto make implicit domain entity for each Microflow. The purpose is described below. - Mendix Forum

Let StudioPro auto make implicit domain entity for each Microflow. The purpose is described below.

0

Let StudioPro auto make implicit domain entity for each Microflow. The purpose is described below.

Firstly, the implicit entity names will not be editable as it will adopt the name of the microflow. And it will get implicit attributes whenever StudioPro sees a microflow added a attribute name passed into any of these 3 new activities GetMember() or SetMember() or WaitOnMembers(). The parameters of a microflow can be thought as a call to activity WaitOnMembers (set of attribute names of $currentAsyncflow).

If a microflow calls a sub-microflow then StudioPro makes a 1-* association between its implicit entities.

Apart from the 3 new activities that StudioPro needs to allow, we need one more:  SyncClient. 

Now the purpose: Creating an object of such implicit entity will be same as calling such a microflow. But now such a microflow can run asynchronous. Alternatively, if a create object triggering a async microflow seems too vague, then use 'Call Microflow' & just throw in a checkbox to choose that it runs async and it returns object of its implicit entity. In other words, you can make workflows from just microflows and without needing persistent entities that current workflow implementation is restricted to.

So, after a client microflow FOO triggers a sub-microflow BAR by a simple 'create object' object1, it can also add an activity call WaitOnMembers with 3 parameters:

object1.AttributeA

object1.AttributeB

$currentAsyncflow.AttributeC

This will result in following things:

StudioPro will add AttributeC to implicit entity FOO.

StudioPro will add AttributeA and AttributeB to implicit entity BAR.

At runtime when FOO creates the object1, the microflow BAR will start async. FOO will continue on until it meets the WaitOnMembers having 3 parameters. It will wait till all 3 happen: 

 AttributeC was set on FOO's implicit object by its caller or by itself.

 AttributeA was set on BAR's implicit object and SyncClient was called from inside BAR.

 AttributeB was set on BAR's implicit object and SyncClient was called from inside BAR.

 

SyncClient inside BAR will sync the attribute values of object1 between FOO and BAR. So if refresh-in-client was used from inside BAR it will set the values to object1 in FOO. And if FOO happens to alter the object1 values those will be set into the BAR microflow which is still continuing to run.

 

Need StudioPro to make $currentAsyncflow available that gives reference to microflow instance's object.

Using this BAR can retrieve the caller microflow instance objectC through association. Then call a WaitOnMembers on objectC or its attributes to wait on FOO to send, until which the BAR will remain waiting. 

 

Implicit entities are non-persistent by default but if designer wants to make any of those persistent and has a generous database, they can. Group the implicit entities in the existing Domain model or make a dedicated panel for it. Also, if designer does not want to make a microflow async he can still resort to existing activity Call Microflow, just uncheck the checkbox of async. 

I did not mention nanoflow here as I believe that one day those too will be termed as microflows containing some special nanoflows' activities. 

 

asked
0 answers