You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/csharp/extensibility-api-howtos/create-microflows-calculations.md
+26-19Lines changed: 26 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,11 +194,11 @@ Like the multiplication microflow example above, the strings `addition1` and `ad
## Create Microflow Activities That Call Java Actions
197
+
## Create Call Activities
198
198
199
-
Once a microflow is created, you need to add a call activity (`IActionActivity`). In the example, you have a method called `CreatMicroflowCallActivity` that can be used by both your multiplication and addition microflows.
199
+
After you create a microflow, you need to add a call activity (`IActionActivity`) so it can be used by other microflows. In the example, there is a method called `CreatMicroflowCallActivity` that works for both your multiplication and addition microflows.
200
200
201
-
There are a few prerequisites that you must complete before a microflow can be called by another microflow. This method can be broken down into parts:
201
+
Before one microflow can call another, you need to complete some prerequisites. This method can be broken down into parts:
In order to create `IActionActivity`, `IMicroflowCallAction` must also be created, and set as the `Action` property of the `IActionActivity`.
213
+
1. Create `IActionActivity`. This is the activity that will call another microflow.
214
+
2. Create `IMicroflowCallAction` and set it as the `Action` property of the `IActionActivity`.
215
+
3. Create `IMicroflowCall` and set as the `MicroflowCall` property of the `IMicroflowCallAction`.
216
+
4. Set `QualifiedName` of the microflow you want to call as the `Microflow` property of the `MicroflowCall` object.
217
+
5. Set the `OutputVariableName` on so the calling microflow can use the result returned by the called microflow.
214
218
215
-
Then, for `IMicroflowCallAction`, `IMicroflowCall` must also be created and set as the `MicroflowCall` property of the `IMicroflowCallAction`.
219
+
## Passing Parameters to Called Microflows
216
220
217
-
Next, `QualifiedName` of the microflow, which is to be called by this activity, must be set as the `Microflow` property of the `MicroflowCall` object.
218
-
219
-
Finally, you can set `OutputVariableName` on `IActionActivity`, which is what the calling microflow will read from the called microflow.
220
-
221
-
## Passing Parameters
222
-
223
-
It is also possible to pass a set of parameters to the action activity, which will be the inputs for the called microflow. This set of parameters is a simple `Tuple` of a name and an expression. In the example, these parameters are the two integers for the multiplication microflow and the two decimals for the addition microflow.
221
+
You can pass parameters to the action activity, which will be the input for the called microflow. This set of parameters is a `Tuple` of a name and an expression. In the example, these parameters are the two integers for the multiplication microflow and the two decimals for the addition microflow.
To create a call activity for your multiplication and addition microflows, you can use something like the code below. As you can see, the parameter names for the activity match the parameter name from the microflow and their values are also passed in for integers and decimals.
263
+
To create a call activity for your multiplication and addition microflows, use code similar to the following:
As you can see, the parameter names for the activity match the parameter name from the microflow. Their values are passed in for integers and decimals.
Outside of this calculation examples, you might want to create a microflow activity that calls a Java action file. See below for how to add an activity, and action and a call to the microflow to achieve that. Same as in the previous examples, you have to do this inside a transaction (`IModel.StartTransaction`).
285
+
You can create a microflow activity that calls a Java Action. This must be done inside a transaction (`IModel.StartTransaction`).
286
286
287
-
First, create an `IActionActivity`, just like the calculation example above, but then, its `Action` property will have the type `IJavaActionCallAction` instead of `IMicroflowCallAction`. This `IJavaActionCallAction` will need to know which `IJavaAction` is linked to. You can achieve this by setting the property `JavaAction` on the `IJavaActionCallAction` object to the `IQualifiedName` of the `IJavaAction`. If you are creating a brand new `IJavaAction`, it is important to add it to the module before accessing its `IQualifiedName`. If you have `IJavaAction` already, and you want to set up a call for that one, find it in the app and pass along its `IQualifiedName`. See below for an example.
287
+
1. Start a transaction using `IModel.StartTransaction`.
288
+
2. Create an `IActionActivity`.
289
+
3. Set the `Action` property to `IJavaActionCallAction`.
290
+
4. Link `IJavaActionCallAction` to the `IJavaAction`.
291
+
5. Set the `JavaAction` property to the `IQualifiedName` of the `IJavaAction`.
292
+
6. For `IJavaAction`:
293
+
1. For a new `IJavaAction` – add it to the module. Only access its `IQualifiedName` after it has been added.
294
+
2. For an existing `IJavaAction` – find it in the app and pass its `IQualifiedName` to the `IJavaAction` property of `IJavaActionCallAction`.
@@ -310,7 +317,7 @@ public void CreateMicroflowAndJavaAction(IModule module, IModel currentApp)
310
317
}
311
318
```
312
319
313
-
If you already have a Java action file that you previously created, simply pass its `IQualifiedName` to the Java action. You will need to query the model in order to retrieve the actual object. You can do so as follows:
320
+
If you already previously created a Java action file, you can pass its `IQualifiedName` to the Java action. You will need to query the model to retrieve the actual object. You can do so as follows:
0 commit comments