Creating Parameter on MicroflowCallParameterMapping usin SDK?

1
How do I add a parameter using the SDK to a microflow call action? I've created in order a: MicroflowCallAction MicroflowCall on MicroflowCallAction MicroflowCallParameterMapping on MicroflowCallAction   Now, how do I add a Parameter on the MicroflowCallParameterMapping? I couldn't find any documentation or example Typescript code fore this. This is what I've got so far: let microflowCallAction = microflows.MicroflowCallAction.createIn(actionActivity); let microflowCall = microflows.MicroflowCall.createIn(microflowCallAction); let destMF = <microflows.Microflow>workingCopy.model().findMicroflowByQualifiedName(microflowName); microflowCallAction.microflowCall.microflow = destMF; console.log(microflowCallAction.microflowCall.parameterMappings.length); // Logs 2 let parameterMapping = MicroflowCallParameterMapping.createIn(microflowCall); // How to add the parameter? This is what I can't seem to do parameterMapping.parameter = ???? // This throws an error as parameterQualifiedName has only got a getter parameterMapping.parameterQualifiedName = 'Module.Microflow.Parametername'; parameter.argument = 'Some value'; // SNIPPET for Simon } else if (action instanceof microflows.MicroflowCallAction) { return (action.outputVariableName ? "var " + action.outputVariableName + " = " : "") + action.microflowCall.microflowQualifiedName + "(" + action.microflowCall.parameterMappings.map(x => x.parameterQualifiedName.split(".").splice(2, 1) + "=" + x.argument).join(", ") + ")"; } else if (action instanceof microflows.RetrieveAction) {  
asked
3 answers
1

Hi Herman,

The parameters property of a Microflow is a derived property,  and we do not support derived properties in the SDK yet. Therefore the parameters of a Microflow are currently always empty.

Regards, Jos Warmer

answered
0

Hi Herman, one thing I usually do when I don't know the correct script to use is reverse engineer an example model. 

You can use this script to do so: 

https://github.com/mendix/mendixplatformsdk-examples/tree/master/reverse-engineering

 

It will generate you the code needed to redevelop the model.

answered
0

Hi, in the mean time this question has been answered at https://forum.mendix.com/link/questions/87491. It describes a work-around to set the parameter.

answered