Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
minLevel2

 Task Overview

Image Added

Anchor
_Toc330995019
_Toc330995019
Activities

Anchor
_Toc330995020
_Toc330995020
Collection Of Objects From String


This activity outputs a Collection of elements from an Input Stringsplits the InputString parameter based on the Separator parameter and builds a collection of Object items as output.

Anchor
_Toc330995021
_Toc330995021
Get Element From Collection

This activity takes as Input a collection and outputs returns an element from a specified element index from the collectiongiven Input Collection.

Anchor
_Toc330995022
_Toc330995022

 

 

Activities Parameters

Anchor
_Toc330995025
_Toc330995025
Collection

...

Of Objects From String


This activity has two input parameters which are given by the user as IN arguments: 
 Image Removedparameters of string type that allows string values to be inserted in the Expression Editor. The input values for the "InputString" and "Separator" parameters are given via two defined IN arguments of type string.  
 Image Added
 
The two IN arguments are defined with default value in the Parameters area in WF section,Arguments tab in Task Designer panel :
Image Removed Image Added


The Output output values are stored in two defined variables. Given the case, OUT arguments may be used in the same manner. If the output values are not to be passed outside the task, variables need not be defined variables :
Image Removed
Image Removed, but instead set the "Track Outputs" property for this activity to "Yes" and the output values will be displayed in the Tracking Data without storing them in variables/OUT arguments.

Image Added

When defining the variables, the default variable type is string. The "Output Collection" parameter is of type collection<Object> . To define a variable of a different type than the default ones, select the "Browse for Types.." option from the "Variable Type" column.

Image Added

"Browse and Select a .Net Type" window opens. In the Search field, type "Collection" and hit "Enter". After the results are displayed, select the one of type collection<T>. Because the "Output Collection" parameter is of type collection<Object>, select from the drop down list, Object type and hit "Enter".

Image Added

The "Browse and Select a .Net Type" window will close and the "Collection" defined variable will be of type Collection<Object>.

Image Added

The "Count" variable should be of type "Int32" because the output parameter "Output Count" returns a value of type "Int32".

In order to display the values stored in the "Collection" variable, an iterator-type activity must be used to iterate through the elements of the collection and output the stored values. Get Element From Collection activity returns a specific element from the collection based on the "Filter Index" value. If all elements from the collection are to be displayed, a Custom ForEach activity should be used. For showcase purposes, in this task, Get Element From Collection activity is used to display the first element of the collection.

The "Count" variable value may be displayed in the Tracking Data panel using a Write Line activity or any other activity that displays values in the Tracking Data panel.

 

Anchor
_Toc330995026
_Toc330995026
Get Element From Collection

The "Input Collection parameter from Get Element From Collection activity uses the returned Collection from Collection From String activity stored in Collection variable. 
 Image Removed
 
The rest of the input arguments, Filter Index and Name Indexes, are given by the user via IN arguments with default value defined in the Parameters area from WF Designer panel.
Image Removed
The Output values are stored in three defined variables :
Image Removed

...

Execution Result:
Image Removed" parameter is bound to the "Collection" variable which stores the "Output Collection" parameter from Collection Of Objects From String activity.The "Filter Index" parameters represents the position of the element in the collection. If the "Filter Index" parameter is used, the "Name Indexes" parameter may be ignored.
 Image Added
 
The output values are stored in three defined variables. Given the case, OUT arguments may be used in the same manner. If the output values are not to be passed outside the task, variables need not be defined, but instead set the "Track Outputs" property for this activity to "Yes" and the output values will be displayed in the Tracking Data without storing them in variables/OUT arguments.

Image Added

Image Added

In order to display the values stored in the "Collection Count" , "CSVString" and "Element" variables, use  Write Line activity or any other activity that displays values in the Tracking Data panel.