How to change the entity name used in the activity of microflow using SDK

0
Hello! I'm testing make changes to my app using SDK.   My scenario 1. Export my Default App (Entity names are generalized - like Level 1, Level 2) 2. Import the App exported from 1. (I will say this app name is dupe-1) 3. change dupe-1's Entity names using SDK (Level1 to something specific like 'State')   After change Entity names(level 1 to State) my microflow can't find entity. Currently this task is throwing an error because the changed entity name is not applied in microflow activity.(I'm using XPath constraint in microflow activity.) I have already followed several SDK tutorials, but none of them go into the details of a microflow activity.   My question : How can I change the entity name inside microflow activity as well? I want to automate this task using SDK.   Don't recommend me this pages. I already checked.  https://docs.mendix.com/apidocs-mxsdk/mxsdk/ https://medium.com/mendix/begin-your-mendix-sdk-adventure-part-1-bed570501a8b https://www.mendix.com/blog/a-mendix-sdk-primer-part-1/
asked
1 answers
0
 var mfparameter = microflows.MicroflowParameterObject.create(model);
        mfparameter.relativeMiddlePoint = { "x": -30, "y": 15 };
        mfparameter.size = { "width": 30, "height": 30 };
        mfparameter.name = entityName;
        mfparameter.variableType = objectType1; // Note: for this property a default value is defined.

        var microflowObjectCollection1 = microflows.MicroflowObjectCollection.create(model);

        microflowObjectCollection1.objects.push(mfparameter);


        var microflowSave = microflows.Microflow.createIn(folder);
        microflowSave.name = microflowName;
        microflowSave.objectCollection = microflowObjectCollection1; 


        var databaseRetrieveSource1 = microflows.DatabaseRetrieveSource.create(model);
        databaseRetrieveSource1.entity = entity;

Some snippets to achieve this

 

take a look in https://github.com/ChrisdeG/mendilangelo/ for calling code that generates javascript to generate a microflow in stead of copy

answered