Model SDK - Adding a Microflow Call activity to a Microflow

2
Hi all I'm trying to add a microflow call activity to a microflow via the SDK but I'm having some issues setting input parameters. I've used the utils.serializeToJs function to export the details for an existing microflow containing a call to the same microflow but when running that code and updating my project I get the following error in the modeller: "Mendix.Modeler.Utility.Progress.ProgressException ---> System.InvalidOperationException: An error occurred when trying to set the 'Parameter' property of a Microflow call parameter mapping in a Microflow with ID 3a945d2f-749c-4eff-ba7e-363a1dc65ce0. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null. Parameter name: value" I tried calling the function model.findMicroflowParameterByQualifiedName with a qualified name in the format [MODULE_NAME].[MICROFLOW_NAME].[PARAMETER_NAME]  so I could set the 'parameter' property of my microflows.MicroflowCallParameterMapping object but the function always returns null. My code to create the activity is as follows:     var invoiceListCallParameter = microflows.MicroflowCallParameterMapping.create(model); invoiceListCallParameter.argument = "$InvoiceList"; invoiceListCallParameter.argumentModel = expressions.NoExpression.create(model); // this always returns null // var invoiceListParameter = model.findMicroflowParameterByQualifiedName("TemplateAdmin.SUB_ProcessInvoices.InvoiceList") // invoiceListCallParameter.parameter = invoiceListParameter; var processInvoicesCall = microflows.MicroflowCall.create(model); processInvoicesCall.microflow = model.findMicroflowByQualifiedName("TemplateAdmin.SUB_ProcessInvoices"); processInvoicesCall.parameterMappings.push(invoiceListCallParameter); var processInvoicesCallAction = microflows.MicroflowCallAction.create(model); processInvoicesCallAction.microflowCall = processInvoicesCall; processInvoicesCallAction.useReturnVariable = true; processInvoicesCallAction.outputVariableName = "ProcessedCount"; var processInvoicesActivity = microflows.ActionActivity.create(model); processInvoicesActivity.relativeMiddlePoint = {"x":430,"y":200}; processInvoicesActivity.size = {"width":120,"height":60}; processInvoicesActivity.action = processInvoicesCallAction; processInvoicesActivity.autoGenerateCaption = true; microflowObjectCollection.objects.push(processInvoicesActivity); Does anyone know where I might be going wrong? Thanks in advance iain
asked
0 answers