Workflow Manager 1.0 Data Type Support and Expressions Activities

 

Updated: July 12, 2012

Workflow Manager 1.0 provides activities that fall under two categories: activities for working with expressions and data types, and activities for messaging, communications, and building the logic of your workflow applications. The first category of activities are most frequently used behind the scenes as expressions are translated into activity trees composed of activities from the trusted surface. This topic provides an overview of these activities.

The following activities provide support for working with strings.

ActivityDescriptionArguments
CompareStringCompares two strings (similar to IComparable). Supports regular expressions and ignore casing.

Does not support passing an explicit culture (all comparison are done using invariant culture)
InArgument<string> Left

InArgument<string> Right

InArgument<bool> IgnoreCase

OutArgument<int> Result
ConcatStringConcatenate a set of strings.

All inputs must to be string data types and not object.
Collection<InArgument<string> Inputs

OutArgument<bool> Result
ContainsStringReturns true if a string is contained into another string

Contains is always case sensitive.
InArgument<string> Input

InArgument<string> SearchValue

OutArgument<bool> Result
EndsWithStringReturn true if a string ends with another string. Case insensitive operations are supported.

Does not support passing an explicit culture (all comparison are done using invariant culture by design)
InArgument<string> Left

InArgument<string> Right

InArgument<bool> IgnoreCase

OutArgument<bool> Result
FormatStringFormat a string passing a set of arguments. Arguments can be of any type (as the arguments collection is of type InArgument).

Does not support passing an explicit culture (all comparison are done using invariant culture by design)

Custom IFormatProviders are not supported
InArgument<string> Format

Collection<InArgument> Arguments
IndexOfStringReturns the index in which a string occurs in another string.

Does not support passing an explicit culture (all comparison are done using invariant culture by design)

IgnoreCase flag to support case insensitive operations is not supported.
InArgument<string> Input

InArgument<string> SearchValue

InArgument<int> StartIndex

InArgument<int> Count

OutArgument<int> Index
IsEmptyStringReturns true if a string is empty or white spaceInArgument<string> Input

InArgument<bool> CheckForWhiteSpace

OutArgument<bool> Result
IsEqualStringReturns true if two strings are equal. Also supports comparison using RegEx - supports ignoring casing.

Does not support passing an explicit culture (all comparison are done using invariant culture by design)
InArgument<string> Input

InArgument<string> Pattern

InArgument<string> Text

InArgument<bool> IgnoreCase

OutArgument<bool> Result
ReplaceStringReplace one string with another. Supports RegEx replacements.InArgument<string> Input

InArgument<string> Pattern

InArgument<string> ExistingValue

InArgument<string> Replacement

OutArgument<string> Result
SplitStringReturns an array of strings based on an existing string.InArgument<string> Input

InArgument<string> Separator

InArgument<StringSplitOptions> StringSplitOptions

OutArgument<string[]> Result
StartsWithStringReturn true if a string starts with another string. Case insensitive operations are supported.

Does not support passing an explicit culture (all comparison are done using invariant culture by design).
InArgument<string> Left

InArgument<string> Right

bool IgnoreCase

OutArgument<bool> Result
StringLengthReturns the length of a string.InArgument<string> Input

OutArgument<int> Result
SubstringReturns a substring from an existing string. Users can specify a start and a length.InArgument<string> Input

InArgument<int> StartIndex

InArgument<int> Length

OutArgument<string> Result
ToLowerCaseConverts an input string to lower case

Does not support passing an explicit culture (all comparison are done using invariant culture by design).
InArgument<string> Input

OutArgument<string> Result
ToStringConverts an input value into a string. Supports passing a valid .NET format string and a culture name to do be used during the transformation

Does not support passing IFormatProviders (only culture name can be specified)
InArgument Object

InArgument<string> Format

InArgument<string> CultureName

OutArgument<string> Result
ToUpperCaseConverts an input string to upper case

Does not support passing an explicit culture (all comparison are done using invariant culture by design).
InArgument<string> Input

OutArgument<string> Result
TrimTrims the contents of a string

Does not support passing the set of characters to be trimmed.
InArgument<string> Input

OutArgument<string> Result

The following activities are used when working with DateTime and TimeSpan types.

DateTime Activities

ActivityDescriptionArguments
AddToDateAdds to an existing date. Customers can add one or multiple date fragments (e.g. day, minute, month, and so on.) or a timeSpanInArgument<DateTime> Input

InArgument<int> Days

InArgument<int> Months

InArgument<int> Hours

InArgument<int> Minutes

InArgument<int> Milliseconds

InArgument<TimeSpan> TimeSpan

OutArgument<DateTime> Result
CompareDateCompares two dates (similar to IComparable)InArgument<DateTime> Left

InArgument<DateTime> Right

OutArgument<int> Result
ConvertTimeZoneConverts a date between two given time zonesInArgument<DateTime> Input

InArgument<DateTime> SourceTimeZone

InArgument<DateTime> DestinationTimeZone

OutArgument<DateTime> Result
CreateDateCreate an instance of a new DateTime passing the components of the date. Dates can be local or UTC.

Does not support create a date out of the number of ticks.
InArgument<int> Day

InArgument<int> Month

InArgument<int> Year

InArgument<int> Hour

InArgument<int> Minute

InArgument<int> Second

InArgument<DateTimeKind> Kind

OutArgument<DateTime> Result
CurrentDateReturns the current date from the server in UTC time.OutArgument<Result> DateTime
DateInRangeReturns true if a date is within other two datesInArgument<DateTime> Input

InArgument<DateTime> Start

InArgument<DateTime> End

OutArgument<bool> Result
DelayUntilWaits until a given dateInArgument<DateTime> Date
GetDateFieldReturns the fields of DateTime instanceInArgument<DateTime> Input

DateField DateField

OutArgument<int> Result
GetDateFieldsReturns a field of a DateTimeInstanceInArgument<DateTime> Input

OutArgument<int> Year

OutArgument<int> Month

OutArgument<int> Day

OutArgument<int> Hour

OutArgument<int> Minute

OutArgument<int> Second
GetElapsedDaysGet the days elapsed between two dates. Users can exclude weekends and holidaysInArgument<DateTime> Start

InArgument<DateTime> End

InArgument<bool> ExcludeWeekends

InArgument<IEnumerable<DateTime>> ExcludedDates

OutArgument<int> Result
GetElapsedTimeReturns the time elapsed between two datesInArgument<DateTime> Start

InArgument<DateTime> End

OutArgument<TimeSpan> Result
SubtractFromDateSubtracts from a Date. Users can pass a date fragment (e.g. hours or days) or a TimeSpan.InArgument<DateTime> Input

InArgument<int> Days

InArgument<int> Hours

InArgument<int> Minutes

InArgument<int> Seconds

InArgument<TimeSpan> TimeSpan

OutArgument<DateTime> Result
ParseDateParses a string into a DateTime. Supports passing the CultureName (the culture is created within the activity) and the DateTimeStyleInArgument<string> Value

InArgument<DateTimeStyles> DateTimeStyles

InArgument<string> CultureName

TimeSpan Activities

ActivityDescriptionSignature
CreateTimeSpanCreates an instance of a TimeSpanInArgument<int> Days

InArgument<int> Minutes

InArgument<int> Hours

InArgument<int> Seconds

OutArgument<TimeSpan> Result
DelayWaits for a given TimeSpanInArgument<TimeSpan> Duration
GetTimeSpanFieldsGets different fields of a TimeSpanInArgument<TimeSpan> Input

OutArgument<int> Days

OutArgument<int> Hours

OutArgument<int> Minutes

OutArgument<int> Seconds

OutArgument<int> TotalDays

OutArgument<int> TotalHours

OutArgument<int> TotalMinutes

OutArgument<int> TotalSeconds

The following activities provide support for working with Int32 and Double data types.

ActivityDescriptionArguments
Add<T>Adds two numbersInArgument<T> Left

InArgument<T> Right

OutArgument<T> Result
Divide<T>Divides two numbersInArgument<T> Left

InArgument<T> Right

OutArgument<T> Result
IsEqualNumber<T>Returns true if two numbers are equalInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
IsGreaterThan<T>Returns true if a number is greater than anotherInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
IsGreaterThanOrEqual<T>Returns true if a number is greater or equal than anotherInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
IsLessThan<T>Returns true if a number is smaller than anotherInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
IsLessThanOrEqual<T>Returns true if a number is smaller or equal than anotherInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
Mod<T>Mod operationInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
Multiply<T>Multiplies two numbersInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result
ParseNumber<T>Parses a numberInArgument<string> Value

InArgument<string> CultureName

InArgument<NumberStyles> NumberStyles

OutArgument<bool> Result
Subtract<T>Subtracts two numbersInArgument<T> Left

InArgument<T> Right

OutArgument<bool> Result

The following activities provide support for working with Boolean values.

ActivityDescriptionArguments
AndLogical and operationInArgument<bool> Left

InArgument<bool> Right

InArgument<bool> Result
IsEqualBooleanLogical equality between two boolean valuesInArgument<bool> Left

InArgument<bool> Right

InArgument<bool> Result
IsFalseReturns true if a boolean is FalseInArgument<bool> Input

InArgument<bool> Result
IsTrueReturns true if a boolean is TrueInArgument<bool> Input

InArgument<bool> Result
NotNegationInArgument<bool> Input

InArgument<bool> Result
OrLogical OrInArgument<bool> Left

InArgument<bool> Right

InArgument<bool> Result
ParseBooleanParses a BooleanInArgument<string> Input

InArgument<bool> Result

The following activites provide support for working with Guids.

ActivityDescriptionArguments
IsEmptyGuidReturns true if a Guid is emptyInArgument<Guid> Value

OutArgument<bool> Result
IsEqualGuidReturns true if two Guids are equalInArgument<Guid> Left

InArgument<Guid> Right

OutArgument<bool> Result
NewGuidCreates and return a new GuidOutArgument<Guid> Result
ParseGuidParse a guid from a stringInArgument<string> Value

OutArgument<Guid> Result

The following activities provide support for working with collections. The ICollection activities are useful for working with collections of items that can be accessed by index, and the IDictionary activites are useful for working with collections of key/value pairs.

ICollection

ActivityDescriptionArguments
AddToCollection<T>Adds an item to a collection (from System.Activities)InArgument<ICollection<T>> Collection

InArgument<T> Item
RemoveFromCollection<T>Removed an item to a collection (from System.Activities)InArgument<ICollection<T>> Collection

InArgument<T> Item

OutArgument<bool> Result
ExistsInCollection<T>Returns true if an item exists in a collection (from System.Activities)InArgument<ICollection<T>> Collection

InArgument<T> Item

OutArgument<bool> Result
ClearCollection<T>Clears a collection (from System.Activities)InArgument<ICollection<T>> Collection
BuildCollection<T>Creates and initializes a collectionInArgument<IEnumerable<T>> Collection

ICollection<InArgument<T>> ValuesOutArgument<Collection<T>> Result
CountCollection<T>Counts the item in a collectionInArgument<ICollection<T>> Collection

OutArgument<int> Result
GetItemFromCollection<T>Gets an item from a collectionInArgument<ICollection<T>> Collection

InArgument<int> Index

OutArgument<T> Result

IDictionary

ActivityDescriptionArguments
AddToDictionary<K,V>Adds an item to a collection (from System.Activities)InArgument<IDictionary<K,V>> Dictionary

InArgument<K> Key

InArgument<V> Value
RemoveFromDictionary<T>Removed an item to a dictionary (from System.Activities)InArgument<IDictionary<K,V>> Dictionary

InArgument<K> Key
DictionaryContains<K,V>Returns true if an item exists in a dictionary (from System.Activities)InArgument<IDictionary<K,V>> Dictionary

InArgument<K> Key

InArgument<V> Value

OutArgument<bool> Result
ClearDictionary<K,V>Clears a collection (from System.Activities)InArgument<IDictionary<K,V>> Dictionary
BuildDictionary<K,V>Creates and initializes a collectionInArgument<IDictionary<K,V>> Dictionary

IDictionary<TKey, InArgument<TValue>> Values

OutArgument<IDictionary<K,V>> Result
CountDictionary<K,V>Counts the item in a collectionInArgument<IDictionary<K,V>> Dictionary

OutArgument<int> Result
SplitKeyValuePair<K,V>Split the key and the value out of a KeyValuePairInArgument<KeyValuePair<K,V>> Dictionary

OutArgument<K> Key

OutArgument<V> Value
GetDictionaryValue<K,V>Gets a value from a dictionaryInArgument<IDictionary<K,V>> Dictionary

InArgument<K> Key

OutArgument<V> Result

The following activities provide support for exception handling.

ActivityDescriptionArguments
TryCatchException handling in workflows

This activity is from WF4
ThrowThrows an exception

This activity is from WF4
InArgument<Exception> Exception
RethrowRethrows an exception (similar to “throw” without arguments in c#)

This activity is from WF4
CreateException<T>Creates an instance of an exceptionInArgument<string> Message

InArgument<Exception> InnerException

The Uri data type is supported by the trusted list and may be used by other activities that take a Uri as a parameter. It can be created by using the New<Uri> activity, and by the CreateUriFromDynamicValue activity.

Community Additions

ADD
Show: