Moving Folder Entities with the Flow DesignerLast Updated: 07/15/2016 Introduced in Verision: 2.0 |
Folder entities can be moved with the Move Entity component. It can be found in the Toolbox tab, under the category Integration > Entity Framework.
Example
In our example flow, we will use two forms to move a CarPassenger entity from one Car folder to another. This example assumes that our two forms Display Passengers Form and Display Cars Form have already been designed.
We will begin in the Car folder’s behavior actions folder at System > Common Data Elements > Folder Behavior Actions > Transportation.CarFolderBehavior. We will click the Create Flow button.
In the resulting New Flow pop-up, we will name our flow “Move Passenger” and click OK to open it in the Flow Designer.
We will first retrieve all of the Car Passengers in the current Car folder. We will find the Get All Car Passenger By Folder Id component in the Flow Designer start-up window, under the category Integrations >All Integrations > Folder Entity Data Structures > Car Passenger.
In the Mapping Editor, we will map FolderId to Entity Folder Id. Throughout the rest of our example, we should remember that Entity Folder Id always refers to the ID of the folder which contains the entity.
Next, we will get the current Car folder. We will find the Get By ID component in the Toolbox tab, under the category Integration > Internal Services > CarService.
In the Mapping Editor, we will map FolderID to id and rename the output to “Current Car Folder”.
Next, we will get all of the Car folders. We will find the Get Folders By Behavior Type component in the Toolbox tab, under the category Integration > Internal Services > CarService.
In the Mapping Editor, we will map Current Car Folder.EntityFolderId (the ID of the folder which contains our current Car folder) to parentFolderId. We will also define folderBehaviorTypeName as “Transportation.CarFolderBehavior” and rename our output as “Car Folders”.
Next, we will place the form in which the user will select one of the Car Passengers in our current Car folder. We will find the Display Passengers Form in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.
In the Mapping Editor, we will map Results to CarPassengers.
Next, we will place the form in which the user will select a target Car folder to which the CarPassenger will be moved. We will find the Display Cars Form in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.
In the Mapping Editor, we will give SeatPosition a mapping type of “Ignore” and map Car Folders to CarFolders.
Next, we will move our selected Car Passenger to the selected Car and Seat Position. We will find the Move Entity component in the Toolbox tab, under the category Integration > Entity Framework.
In the Mapping Editor, we will map CarPassenger.ID to entityId.
Next, we will map TargetCarFolder.FolderID to folderId.
Once we’ve connected the last of our outcomes, our flow will be complete, so we will save it and close the Flow Designer.
Back in the portal, we will navigate to a Car folder that contains CarPassenger entities.
In the resulting Car Passengers form, we will select a Car Passenger to move and click Done.
In the next form, we will select a target car and seat position, and then click Done.
The Car Passenger we selected will no longer appear in this Car folder.
When we navigate to the target Car folder, we will see our CarPassenger entity.