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.
String Activities
Date Support Activities
DateTime Activities
TimeSpan Activities
Numeric Type Activities
Boolean Activities
Guid Activities
Collection Activities
ICollection
IDictionary
Exception Activities
Uri Activities
String Activities
The following activities provide support for working with strings.
Activity | Description | Arguments |
---|---|---|
CompareString | Compares 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 |
ConcatString | Concatenate a set of strings. All inputs must to be string data types and not object. |
Collection<InArgument<string> Inputs OutArgument<bool> Result |
ContainsString | Returns true if a string is contained into another string Contains is always case sensitive. |
InArgument<string> Input InArgument<string> SearchValue OutArgument<bool> Result |
EndsWithString | Return 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 |
FormatString | Format 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 |
IndexOfString | Returns 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 |
IsEmptyString | Returns true if a string is empty or white space | InArgument<string> Input InArgument<bool> CheckForWhiteSpace OutArgument<bool> Result |
IsEqualString | Returns 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 |
ReplaceString | Replace one string with another. Supports RegEx replacements. | InArgument<string> Input InArgument<string> Pattern InArgument<string> ExistingValue InArgument<string> Replacement OutArgument<string> Result |
SplitString | Returns an array of strings based on an existing string. | InArgument<string> Input InArgument<string> Separator InArgument<StringSplitOptions> StringSplitOptions OutArgument<string[]> Result |
StartsWithString | Return 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 |
StringLength | Returns the length of a string. | InArgument<string> Input OutArgument<int> Result |
Substring | Returns 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 |
ToLowerCase | Converts 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 |
ToString | Converts 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 |
ToUpperCase | Converts 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 |
Trim | Trims the contents of a string Does not support passing the set of characters to be trimmed. |
InArgument<string> Input OutArgument<string> Result |
Date Support Activities
The following activities are used when working with DateTime and TimeSpan types.
DateTime Activities
TimeSpan Activities
DateTime Activities
Activity | Description | Arguments |
---|---|---|
AddToDate | Adds to an existing date. Customers can add one or multiple date fragments (e.g. day, minute, month, and so on.) or a timeSpan | InArgument<DateTime> Input InArgument<int> Days InArgument<int> Months InArgument<int> Hours InArgument<int> Minutes InArgument<int> Milliseconds InArgument<TimeSpan> TimeSpan OutArgument<DateTime> Result |
CompareDate | Compares two dates (similar to IComparable) | InArgument<DateTime> Left InArgument<DateTime> Right OutArgument<int> Result |
ConvertTimeZone | Converts a date between two given time zones | InArgument<DateTime> Input InArgument<DateTime> SourceTimeZone InArgument<DateTime> DestinationTimeZone OutArgument<DateTime> Result |
CreateDate | Create 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 |
CurrentDate | Returns the current date from the server in UTC time. | OutArgument<Result> DateTime |
DateInRange | Returns true if a date is within other two dates | InArgument<DateTime> Input InArgument<DateTime> Start InArgument<DateTime> End OutArgument<bool> Result |
DelayUntil | Waits until a given date | InArgument<DateTime> Date |
GetDateField | Returns the fields of DateTime instance | InArgument<DateTime> Input DateField DateField OutArgument<int> Result |
GetDateFields | Returns a field of a DateTimeInstance | InArgument<DateTime> Input OutArgument<int> Year OutArgument<int> Month OutArgument<int> Day OutArgument<int> Hour OutArgument<int> Minute OutArgument<int> Second |
GetElapsedDays | Get the days elapsed between two dates. Users can exclude weekends and holidays | InArgument<DateTime> Start InArgument<DateTime> End InArgument<bool> ExcludeWeekends InArgument<IEnumerable<DateTime>> ExcludedDates OutArgument<int> Result |
GetElapsedTime | Returns the time elapsed between two dates | InArgument<DateTime> Start InArgument<DateTime> End OutArgument<TimeSpan> Result |
SubtractFromDate | Subtracts 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 |
ParseDate | Parses a string into a DateTime. Supports passing the CultureName (the culture is created within the activity) and the DateTimeStyle | InArgument<string> Value InArgument<DateTimeStyles> DateTimeStyles InArgument<string> CultureName |
TimeSpan Activities
Activity | Description | Signature |
---|---|---|
CreateTimeSpan | Creates an instance of a TimeSpan | InArgument<int> Days InArgument<int> Minutes InArgument<int> Hours InArgument<int> Seconds OutArgument<TimeSpan> Result |
Delay | Waits for a given TimeSpan | InArgument<TimeSpan> Duration |
GetTimeSpanFields | Gets different fields of a TimeSpan | InArgument<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 |
Numeric Type Activities
The following activities provide support for working with Int32 and Double data types.
Activity | Description | Arguments |
---|---|---|
Add<T> | Adds two numbers | InArgument<T> Left InArgument<T> Right OutArgument<T> Result |
Divide<T> | Divides two numbers | InArgument<T> Left InArgument<T> Right OutArgument<T> Result |
IsEqualNumber<T> | Returns true if two numbers are equal | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
IsGreaterThan<T> | Returns true if a number is greater than another | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
IsGreaterThanOrEqual<T> | Returns true if a number is greater or equal than another | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
IsLessThan<T> | Returns true if a number is smaller than another | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
IsLessThanOrEqual<T> | Returns true if a number is smaller or equal than another | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
Mod<T> | Mod operation | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
Multiply<T> | Multiplies two numbers | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
ParseNumber<T> | Parses a number | InArgument<string> Value InArgument<string> CultureName InArgument<NumberStyles> NumberStyles OutArgument<bool> Result |
Subtract<T> | Subtracts two numbers | InArgument<T> Left InArgument<T> Right OutArgument<bool> Result |
Boolean Activities
The following activities provide support for working with Boolean values.
Activity | Description | Arguments |
---|---|---|
And | Logical and operation | InArgument<bool> Left InArgument<bool> Right InArgument<bool> Result |
IsEqualBoolean | Logical equality between two boolean values | InArgument<bool> Left InArgument<bool> Right InArgument<bool> Result |
IsFalse | Returns true if a boolean is False | InArgument<bool> Input InArgument<bool> Result |
IsTrue | Returns true if a boolean is True | InArgument<bool> Input InArgument<bool> Result |
Not | Negation | InArgument<bool> Input InArgument<bool> Result |
Or | Logical Or | InArgument<bool> Left InArgument<bool> Right InArgument<bool> Result |
ParseBoolean | Parses a Boolean | InArgument<string> Input InArgument<bool> Result |
Guid Activities
The following activites provide support for working with Guids.
Activity | Description | Arguments |
---|---|---|
IsEmptyGuid | Returns true if a Guid is empty | InArgument<Guid> Value OutArgument<bool> Result |
IsEqualGuid | Returns true if two Guids are equal | InArgument<Guid> Left InArgument<Guid> Right OutArgument<bool> Result |
NewGuid | Creates and return a new Guid | OutArgument<Guid> Result |
ParseGuid | Parse a guid from a string | InArgument<string> Value OutArgument<Guid> Result |
Collection Activities
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
IDictionary
ICollection
Activity | Description | Arguments |
---|---|---|
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 collection | InArgument<IEnumerable<T>> Collection ICollection<InArgument<T>> ValuesOutArgument<Collection<T>> Result |
CountCollection<T> | Counts the item in a collection | InArgument<ICollection<T>> Collection OutArgument<int> Result |
GetItemFromCollection<T> | Gets an item from a collection | InArgument<ICollection<T>> Collection InArgument<int> Index OutArgument<T> Result |
IDictionary
Activity | Description | Arguments |
---|---|---|
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 collection | InArgument<IDictionary<K,V>> Dictionary IDictionary<TKey, InArgument<TValue>> Values OutArgument<IDictionary<K,V>> Result |
CountDictionary<K,V> | Counts the item in a collection | InArgument<IDictionary<K,V>> Dictionary OutArgument<int> Result |
SplitKeyValuePair<K,V> | Split the key and the value out of a KeyValuePair | InArgument<KeyValuePair<K,V>> Dictionary OutArgument<K> Key OutArgument<V> Value |
GetDictionaryValue<K,V> | Gets a value from a dictionary | InArgument<IDictionary<K,V>> Dictionary InArgument<K> Key OutArgument<V> Result |
Exception Activities
The following activities provide support for exception handling.
Activity | Description | Arguments |
---|---|---|
TryCatch | Exception handling in workflows This activity is from WF4 |
|
Throw | Throws an exception This activity is from WF4 |
InArgument<Exception> Exception |
Rethrow | Rethrows an exception (similar to “throw” without arguments in c#) This activity is from WF4 |
|
CreateException<T> | Creates an instance of an exception | InArgument<string> Message InArgument<Exception> InnerException |
Uri Activities
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.