Skip to content

Commit 253269a

Browse files
committed
Review
1 parent 6cb38c0 commit 253269a

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/csharp/extensibility-api-howtos/create-microflow-service.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `Initialize` method initializes a microflow that was previously created. Fol
1616
1. Start a transaction using `IModel.StartTransaction`.
1717
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.
1818
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.
2020

2121
### Example
2222

@@ -54,7 +54,7 @@ The `CreateMicroflow` method is the more advanced and comprehensive method to cr
5454

5555
* The current `IModel`
5656
* `IFolderBase` (module or folder)
57-
* A name,
57+
* A name
5858
* Optional:
5959
* `MicroflowReturnValue`
6060
* List of parameters
@@ -93,36 +93,46 @@ In this more advanced example, you see the `IMicroflowExpressionService.CreateFr
9393
}
9494
```
9595

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/).
9797

98-
## `TryInsertAfterStart` and `TryInsertBeforeActivity`
98+
## Inserting Activities
9999

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
101104

102105
```csharp
103106
microflowService.TryInsertAfterStart(microflow, newActivity);
104107
microflowService.TryInsertBeforeActivity(newAactivity, existingActivity);
105108
```
106109

107-
## `GetParameters`
110+
## Retrieving Microflow Parameters
111+
112+
Use `GetParameters` method to retrieve all the input parameters of a microflow.
113+
114+
It returns a list of `IMicroflowParameterObject`, which includes:
108115

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.
116+
* Name
117+
* `IQualifiedName` identifier
118+
* Description
119+
* `DataType`
110120

111121
```csharp
112122
IReadOnlyList<IMicroflowParameterObject> parameters = _microflowService.GetParameters(microflow);
113123
```
114124

115-
## `GetAllMicroflowActivities`
125+
## Retrieving Microflow Activities
116126

117-
The `GetAllMicroflowActivities` method enables retrieving all the activities in the flow of a microflow. It returns a list of `IActivity`.
127+
Use the `GetAllMicroflowActivities` method to retrieve all the activities in the flow of a microflow. It returns a list of `IActivity`.
118128

119129
```csharp
120130
IReadOnlyList<IActivity> activities = _microflowService.GetAllMicroflowActivities(microflow);
121131
```
122132

123-
## `IsVariableNameInUse`
133+
## Checking for Variable Name Conflicts
124134

125-
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.
126136

127137
```csharp
128138
public void AddNewActivity(IModel currentApp, IMicroflow microflow, string activityName)

0 commit comments

Comments
 (0)