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-microflow-service.md
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The `Initialize` method initializes a microflow that was previously created. Fol
16
16
1. Start a transaction using `IModel.StartTransaction`.
17
17
2. Create a microflow and add it to the module. Use `IModel.Create<IMicroflow>` to create the microflow and add it to the desired module.
18
18
3. Initialize the microflow by calling `IMicroflowService.Initialize`. The `Initialize` method sets up the start and end flows, and adds any parameters (for example, `boolParameter` of `DataType.Boolean`).
19
-
4. Insert activities into the microflow using `IMicroflowService.TryInsertAfterStart` to add the first activity, and `IMicroflowService.TryInsertBeforeActivity` to insert subsequent activities.
19
+
4. Insert activities into the microflow using `IMicroflowService.TryInsertAfterStart` to add the first activity, and `IMicroflowService.TryInsertBeforeActivity` to insert activities before others.
20
20
21
21
### Example
22
22
@@ -54,7 +54,7 @@ The `CreateMicroflow` method is the more advanced and comprehensive method to cr
54
54
55
55
* The current `IModel`
56
56
*`IFolderBase` (module or folder)
57
-
* A name,
57
+
* A name
58
58
* Optional:
59
59
*`MicroflowReturnValue`
60
60
* List of parameters
@@ -93,36 +93,46 @@ In this more advanced example, you see the `IMicroflowExpressionService.CreateFr
93
93
}
94
94
```
95
95
96
-
The `IMicroflowService.CreateMicroflow` method is a bit easier to use than the `IMicroflowService.Initialize` method because it doesn't require manually creating the microflow with `IModel.Create<IMicroflow>` and then manually adding it to the `IFolderBase` container. It can do everything behind the scenes as long as everything is supplied to it. For a comprehensive example on how to create microflows, see [Create Microflows for Calculations Using C#](/apidocs-mxsdk/apidocs/csharp-extensibility-api-11/create-microflows-for-calculations/).
96
+
The `IMicroflowService.CreateMicroflow` method does not require manually creating the microflow with `IModel.Create<IMicroflow>`, then manually adding it to the `IFolderBase` container. For a comprehensive example on how to create microflows, see [Create Microflows for Calculations Using C#](/apidocs-mxsdk/apidocs/csharp-extensibility-api-11/create-microflows-for-calculations/).
97
97
98
-
## `TryInsertAfterStart` and `TryInsertBeforeActivity`
98
+
## Inserting Activities
99
99
100
-
The `TryInsertAfterStart` and `TryInsertBeforeActivity` methods enable inserting an activity in the flow. It can be added right after the start event of the microflow, or be inserted before another specific activity.
100
+
Use the following methods to insert activities into microflows:
101
+
102
+
*`TryInsertAfterStart` – adds an immediately after the start event
103
+
*`TryInsertBeforeActivity` – inserts an actvitiy before another specific activity
Use `GetParameters` method to retrieve all the input parameters of a microflow.
113
+
114
+
It returns a list of `IMicroflowParameterObject`, which includes:
108
115
109
-
The `GetParameters` method enables retrieving all the parameters that are inputs into a microflow. It returns a list of `IMicroflowParameterObject`, which is composed of its name, its `IQualifiedName` identifier, a description, and its `DataType`. Any parameters passed into the microflow will be returned here together with their type.
The `IsVariableNameInUse` method can check if the microflow already contains a variable with the name provided. This can be called before adding a new activity to the flow whose output variable name can overlap with existing variables. An example is as follows:
135
+
Use the `IsVariableNameInUse` method to check if the microflow already contains a variable with the name provided. This can be called before adding a new activity to the flow whose output variable name can overlap with existing variables.
0 commit comments