Merge pull request #1 from Microsoft/master

Updating my fork from original repo.
This commit is contained in:
Jay Van der Zant 2019-04-07 11:44:53 +01:00 коммит произвёл GitHub
Родитель 7d68106b94 c0282dcd2c
Коммит 9c401b97fc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
15 изменённых файлов: 571 добавлений и 139 удалений

Просмотреть файл

@ -7,6 +7,34 @@ All notable changes to MIMWAL project will be documented in this file. The "Unre
* Support for multi-valued attributes in `[//Effective]` lookup in AuthZ workflows.
* Implement Approve Request Activity.
* Support for `[//Value]` lookups in Query definitions across rest of the activities.
------------
### Version 2.19.0111.0
#### Changed
* [Generate Unique Value Activity][GenerateUniqueValueActivity] now has the Conflict Filter search optimisation logic for the *starts-with* XPath function as documented in the [Wiki](https://github.com/Microsoft/MIMWAL/wiki/Generate-Unique-Value-Activity#conflict-filter) turned off by default.
To get the backward compatible behaviour, define the app setting GenerateUniqueValueActivity_OptimizeUniquenessKey = true in the FIMService app.config.
------------
### Version 2.18.1110.0
#### Changed
* [FormatMultivaluedList][FormatMultivaluedListFunction] now accepts all null values.
* [DateTimeAdd][DateTimeAddFunction] now accepts a null value for timespan parameter.
* [ConvertStringToGuid][ConvertStringToGuidFunction] returns Empty GUID if the input is a null/empty string.
* [ConvertFromBase64][ConvertFromBase64Function] returns null if the input is a null/empty string.
* [ConvertToBase64][ConvertToBase64Function] returns null if the input is a null/empty string.
* [ConvertToNumber][ConvertToNumberFunction] returns 0 if the input is a null/empty string.
* [SplitString][SplitStringFunction] returns null if the input is a null/empty string.
* [RemoveDuplicates][RemoveDuplicatesFunction] returns null if the input is a null list.
* [Eq][EqFunction] function will return true if one string parameter is null and other string parameter is Empty
#### Removed
* Removed validation check from RunPowerShellScript activity UI from that the PowerShell User Password is Decryptable as the code runs under the context of submitter instead of FIMService plus the code runs on the Portal Server which may not be co-located with FIMService server.
------------
@ -174,20 +202,89 @@ All notable changes to MIMWAL project will be documented in this file. The "Unre
* There are no bug fixes in this release.
[NormalizeStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/NormalizeString-Function
[RunPowerShellScriptActivity]: https://github.com/Microsoft/MIMWAL/wiki/Run-PowerShell-Script-Activity
[UpdateResourcesActivity]: https://github.com/Microsoft/MIMWAL/wiki/Update-Resources-Activity
[EvaluateExpressionFunction]: https://github.com/Microsoft/MIMWAL/wiki/EvaluateExpression-Function
[FormatMultivaluedListFunction]: https://github.com/Microsoft/MIMWAL/wiki/FormatMultivaluedList-Function
[ConvertToUniqueIdentifierFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertToUniqueIdentifier-Function
[AddFunction]: https://github.com/Microsoft/MIMWAL/wiki/Add-Function
[AfterFunction]: https://github.com/Microsoft/MIMWAL/wiki/After-Function
[AndFunction]: https://github.com/Microsoft/MIMWAL/wiki/And-Function
[BeforeFunction]: https://github.com/Microsoft/MIMWAL/wiki/Before-Function
[BitAndFunction]: https://github.com/Microsoft/MIMWAL/wiki/BitAnd-Function
[BitNotFunction]: https://github.com/Microsoft/MIMWAL/wiki/BitNot-Function
[BitOrFunction]: https://github.com/Microsoft/MIMWAL/wiki/BitOr-Function
[ConcatenateFunction]: https://github.com/Microsoft/MIMWAL/wiki/Concatenate-Function
[ConcatenateMultivaluedStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConcatenateMultivaluedString-Function
[ContainsFunction]: https://github.com/Microsoft/MIMWAL/wiki/Contains-Function
[ConvertFromBase64Function]: https://github.com/Microsoft/MIMWAL/wiki/ConvertFromBase64-Function
[ConvertNumberToListFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertNumberToList-Function
[ConvertSIDToStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertSIDToString-Function
[ConvertStringToGUIDFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertStringToGUID-Function
[ConvertToBase64Function]: https://github.com/Microsoft/MIMWAL/wiki/ConvertToBase64-Function
[ConvertToBooleanFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertToBoolean-Function
[ConvertToNumberFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertToNumber-Function
[ConvertToStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertToString-Function
[ConvertToUniqueIdentifierFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertToUniqueIdentifier-Function
[CountFunction]: https://github.com/Microsoft/MIMWAL/wiki/Count-Function
[CreateSqlParameterFunction]: https://github.com/Microsoft/MIMWAL/wiki/CreateSqlParameter-Function
[CreateSqlParameter2Function]: https://github.com/Microsoft/MIMWAL/wiki/CreateSqlParameter2-Function
[ExecuteSqlNonQueryFunction]: https://github.com/Microsoft/MIMWAL/wiki/ExecuteSqlNonQuery-Function
[ExecuteSqlScalarFunction]: https://github.com/Microsoft/MIMWAL/wiki/ExecuteSqlScalar-Function
[ValueByKeyFunction]: https://github.com/Microsoft/MIMWAL/wiki/ValueByKey-Function
[CRLFFunction]: https://github.com/Microsoft/MIMWAL/wiki/CRLF-Function
[DateTimeAddFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeAdd-Function
[DateTimeFormatFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeFormat-Function
[DateTimeFromFileTimeUTCFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeFromFileTimeUTC-Function
[DateTimeFromStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeFromString-Function
[ConvertNumberToListFunction]: https://github.com/Microsoft/MIMWAL/wiki/ConvertNumberToList-Function
[MultiplyFunction]: https://github.com/Microsoft/MIMWAL/wiki/Multiply-Function
[DateTimeNowFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeNow-Function
[DateTimeSubtractFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeSubtract-Function
[DateTimeToFileTimeUTCFunction]: https://github.com/Microsoft/MIMWAL/wiki/DateTimeToFileTimeUTC-Function
[DivideFunction]: https://github.com/Microsoft/MIMWAL/wiki/Divide-Function
[EqFunction]: https://github.com/Microsoft/MIMWAL/wiki/Eq-Function
[EscapeDNComponentFunction]: https://github.com/Microsoft/MIMWAL/wiki/EscapeDNComponent-Function
[EvaluateExpressionFunction]: https://github.com/Microsoft/MIMWAL/wiki/EvaluateExpression-Function
[ExecuteSqlScalarFunction]: https://github.com/Microsoft/MIMWAL/wiki/ExecuteSqlScalar-Function
[ExecuteSqlNonQueryFunction]: https://github.com/Microsoft/MIMWAL/wiki/ExecuteSqlNonQuery-Function
[FirstFunction]: https://github.com/Microsoft/MIMWAL/wiki/First-Function
[FormatMultivaluedListFunction]: https://github.com/Microsoft/MIMWAL/wiki/FormatMultivaluedList-Function
[GenerateRandomPasswordFunction]: https://github.com/Microsoft/MIMWAL/wiki/GenerateRandomPassword-Function
[GreaterThanFunction]: https://github.com/Microsoft/MIMWAL/wiki/GreaterThan-Function
[IIFFunction]: https://github.com/Microsoft/MIMWAL/wiki/IIF-Function
[InsertValuesFunction]: https://github.com/Microsoft/MIMWAL/wiki/InsertValues-Function
[IsPresentFunction]: https://github.com/Microsoft/MIMWAL/wiki/IsPresent-Function
[LastFunction]: https://github.com/Microsoft/MIMWAL/wiki/Last-Function
[LeftFunction]: https://github.com/Microsoft/MIMWAL/wiki/Left-Function
[LeftPadFunction]: https://github.com/Microsoft/MIMWAL/wiki/LeftPad-Function
[LengthFunction]: https://github.com/Microsoft/MIMWAL/wiki/Length-Function
[LessThanFunction]: https://github.com/Microsoft/MIMWAL/wiki/LessThan-Function
[LowerCaseFunction]: https://github.com/Microsoft/MIMWAL/wiki/LowerCase-Function
[LTrimFunction]: https://github.com/Microsoft/MIMWAL/wiki/LTrim-Function
[MidFunction]: https://github.com/Microsoft/MIMWAL/wiki/Mid-Function
[ModFunction]: https://github.com/Microsoft/MIMWAL/wiki/Mod-Function
[MultiplyFunction]: https://github.com/Microsoft/MIMWAL/wiki/Multiply-Function
[NormalizeStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/NormalizeString-Function
[NotFunction]: https://github.com/Microsoft/MIMWAL/wiki/Not-Function
[NullFunction]: https://github.com/Microsoft/MIMWAL/wiki/Null-Function
[OrFunction]: https://github.com/Microsoft/MIMWAL/wiki/Or-Function
[ParametersContainFunction]: https://github.com/Microsoft/MIMWAL/wiki/ParametersContain-Function
[ParametersListFunction]: https://github.com/Microsoft/MIMWAL/wiki/ParametersList-Function
[ParametersTableFunction]: https://github.com/Microsoft/MIMWAL/wiki/ParametersTable-Function
[ParameterValueFunction]: https://github.com/Microsoft/MIMWAL/wiki/ParameterValue-Function
[ParameterValueAddedFunction]: https://github.com/Microsoft/MIMWAL/wiki/ParameterValueAdded-Function
[ParameterValueRemovedFunction]: https://github.com/Microsoft/MIMWAL/wiki/ParameterValueRemoved-Function
[ProperCaseFunction]: https://github.com/Microsoft/MIMWAL/wiki/ProperCase-Function
[RandomNumFunction]: https://github.com/Microsoft/MIMWAL/wiki/RandomNum-Function
[RegexMatchFunction]: https://github.com/Microsoft/MIMWAL/wiki/RegexMatch-Function
[RegexReplaceFunction]: https://github.com/Microsoft/MIMWAL/wiki/RegexReplace-Function
[RemoveDuplicatesFunction]: https://github.com/Microsoft/MIMWAL/wiki/RemoveDuplicates-Function
[RemoveValuesFunction]: https://github.com/Microsoft/MIMWAL/wiki/RemoveValues-Function
[ReplaceStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/ReplaceString-Function
[RightFunction]: https://github.com/Microsoft/MIMWAL/wiki/Right-Function
[RightPadFunction]: https://github.com/Microsoft/MIMWAL/wiki/RightPad-Function
[RTrimFunction]: https://github.com/Microsoft/MIMWAL/wiki/RTrim-Function
[SortListFunction]: https://github.com/Microsoft/MIMWAL/wiki/SortList-Function
[SplitStringFunction]: https://github.com/Microsoft/MIMWAL/wiki/SplitString-Function
[SubtractFunction]: https://github.com/Microsoft/MIMWAL/wiki/Subtract-Function
[TitleCaseFunction]: https://github.com/Microsoft/MIMWAL/wiki/TitleCase-Function
[TrimFunction]: https://github.com/Microsoft/MIMWAL/wiki/Trim-Function
[UpperCaseFunction]: https://github.com/Microsoft/MIMWAL/wiki/UpperCase-Function
[ValueByIndexFunction]: https://github.com/Microsoft/MIMWAL/wiki/ValueByIndex-Function
[ValueByKeyFunction]: https://github.com/Microsoft/MIMWAL/wiki/ValueByKey-Function
[ValueTypeFunction]: https://github.com/Microsoft/MIMWAL/wiki/ValueType-Function
[WordFunction]: https://github.com/Microsoft/MIMWAL/wiki/Word-Function
[WrapXPathFilterFunction]: https://github.com/Microsoft/MIMWAL/wiki/WrapXPathFilter-Function
[MIMWalFunctionsTable]: https://github.com/Microsoft/MIMWAL/wiki/Functions-Table
[GenerateUniqueValueActivity]: https://github.com/Microsoft/MIMWAL/wiki/Generate-Unique-Value-Activity

Просмотреть файл

@ -7,6 +7,13 @@
NOTE: Edit the Version and PublicKeyToken of the WAL AssemblyName to match the one that you have deployed in GAC.
Also edit the $encryptionCertThumbprint of cert to be used for certificate based encryption.
Finding Assembly verion and PublicKeyToken
gacutil.exe -l | findstr WorkflowActivityLibrary
Creatinig a self signed certificate for MIMWAL (You can use a legacy CSP such as Microsoft Strong Cryptographic Provider as shown in the example below)
$cert = New-SelfSignedCertificate -DnsName "MIMWAL" -CertStoreLocation "cert:\LocalMachine\My" -Provider "Microsoft Strong Cryptographic Provider"
$cert.Thumbprint
As of version v2.18.1110.0, only FIMService account needs read access to the private key of the MIMWAL certificate created above.
#>
$Error.Clear()

Просмотреть файл

@ -22,7 +22,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string Version = "2.18.0318.0";
internal const string Version = "2.19.0112.0";
/// <summary>
/// File Version information for the assembly consists of the following four values:
@ -31,6 +31,6 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string FileVersion = "2.18.0318.0";
internal const string FileVersion = "2.19.0112.0";
}
}

Просмотреть файл

@ -569,15 +569,17 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI.Forms
return false;
}
try
{
ProtectedData.DecryptData(this.powerShellUserPassword.Value);
}
catch (WorkflowActivityLibraryException ex)
{
this.controller.ValidationError = ex.Message;
return false;
}
// Limited value in this check as the code runs under the context of submitter instead of FIMService plus
// code run on the Portal Server which may not be co-located with FIMService server.
////try
////{
//// ProtectedData.DecryptData(this.powerShellUserPassword.Value);
////}
////catch (WorkflowActivityLibraryException ex)
////{
//// this.controller.ValidationError = ex.Message;
//// return false;
////}
}
// If no errors were found, clear any validation error and return true

Просмотреть файл

@ -13,9 +13,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
#region Namespaces Declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Workflow.Activities;
using System.Workflow.ComponentModel;
using MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common;
@ -173,6 +175,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.AddDelayOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.AddDelayOnSequenceComplete);
}
}
/// <summary>
/// Handles the ExecuteCode event of the ParseExpressions CodeActivity.
/// </summary>

Просмотреть файл

@ -590,6 +590,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.CreateResourceOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.CreateResourceOnSequenceComplete);
}
}
/// <summary>
/// Handles the ExecuteCode event of the ParseDefinitions CodeActivity.
/// </summary>

Просмотреть файл

@ -362,6 +362,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.DeleteResourcesOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.DeleteResourcesOnSequenceComplete);
}
}
/// <summary>
/// Handles the ExecuteCode event of the PrepareResolve CodeActivity.
/// </summary>

Просмотреть файл

@ -207,6 +207,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
{
this.maxLoopCount = 512;
}
if (!bool.TryParse(ConfigurationManager.AppSettings["GenerateUniqueValueActivity_OptimizeUniquenessKey"], out this.optimizeUniquenessKey))
{
this.optimizeUniquenessKey = false;
}
}
finally
{
@ -412,6 +417,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.GenerateUniqueValueOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.GenerateUniqueValueOnSequenceComplete);
}
}
/// <summary>
/// Resolves the value filter.
/// </summary>
@ -490,7 +524,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
Logger.Instance.WriteMethodEntry(EventIdentifier.GenerateUniqueValueSetAttributesToReadForConflictResources, "Filter: '{0}'.", this.ConflictFilter);
this.FindConflict.Attributes = null;
this.optimizeUniquenessKey = false;
////this.optimizeUniquenessKey = false; // Now this flag can only be set by app.config.
string filter = this.ConflictFilter;
try
{
@ -504,18 +538,31 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
while (startIndex != -1)
{
int endIndex = filter.IndexOf(endToken, startIndex, StringComparison.OrdinalIgnoreCase);
string s = filter.Substring(startIndex + startTokenLength + 1, endIndex - (startIndex + startTokenLength + 1)).Trim(new char[] { ' ', '(', ',' });
attributes.Add(s);
if (endIndex != -1)
{
string s = filter.Substring(startIndex + startTokenLength + 1, endIndex - (startIndex + startTokenLength + 1)).Trim(new char[] { ' ', '(', ',' });
attributes.Add(s);
}
else
{
// just increment - should never be here as now this function should not get called unless this.optimizeUniquenessKey is set true via app.cong. Issue #61
endIndex = startIndex + startTokenLength;
}
filter = filter.Substring(endIndex);
startIndex = filter.IndexOf(startToken, StringComparison.Ordinal);
}
if (attributes.Count > 0)
{
this.optimizeUniquenessKey = true;
////this.optimizeUniquenessKey = true; // Now this flag can only be set by app.config.
this.FindConflict.Attributes = attributes.ToArray();
Logger.Instance.WriteVerbose(EventIdentifier.GenerateUniqueValueSetAttributesToReadForConflictResources, "Filter: '{0}'. Attributes: '{1}'.", this.ConflictFilter, string.Join(";", attributes.ToArray()));
}
else
{
this.optimizeUniquenessKey = false; // Turn the config flag off as the conflict filter does not use starts-with function.
}
}
finally
{
@ -711,8 +758,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
{
// Find the attributes to read on potentially conflicing resources
// so that the uniqueness seed can be repositioned instead of simply incremented
// when the conflict filter XPath uses a starts-with fuction
this.SetAttributesToReadForConflictResources();
// when the conflict filter XPath uses a starts-with fuction
if (this.optimizeUniquenessKey)
{
this.SetAttributesToReadForConflictResources();
}
// Default the uniqueness key to the specified uniqueness seed,
// resolve the first value expression in the list, and use that value to resolve

Просмотреть файл

@ -408,6 +408,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.RequestApprovalOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.RequestApprovalOnSequenceComplete);
}
}
/// <summary>
/// Handles the ExecuteCode event of the ParseExpressions CodeActivity.
/// </summary>

Просмотреть файл

@ -21,6 +21,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Reflection;
@ -516,6 +517,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.RunPowerShellScriptOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.RunPowerShellScriptOnSequenceComplete);
}
}
/// <summary>
/// Sets up the PowerShell shell stream event handlers.
/// </summary>

Просмотреть файл

@ -525,6 +525,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.SendEmailNotificationOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.SendEmailNotificationOnSequenceComplete);
}
}
/// <summary>
/// Converts the specified email template resolved expression into a Guid object
/// </summary>

Просмотреть файл

@ -440,6 +440,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.UpdateResourcesOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.UpdateResourcesOnSequenceComplete);
}
}
/// <summary>
/// Handles the ExecuteCode event of the Prepare CodeActivity.
/// </summary>

Просмотреть файл

@ -388,6 +388,35 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Determines the action taken when the activity has completed execution.
/// </summary>
/// <param name="executionContext">The execution context of the activity.</param>
protected override void OnSequenceComplete(ActivityExecutionContext executionContext)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.VerifyRequestOnSequenceComplete);
try
{
// Clear the variable cache for the expression evaluator
// so that any variables, such as SqlParameter, not marked as serializable does not cause dehyration issues.
if (this.ActivityExpressionEvaluator != null
&& this.ActivityExpressionEvaluator.VariableCache != null
&& this.ActivityExpressionEvaluator.VariableCache.Keys != null)
{
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.VerifyRequestOnSequenceComplete);
}
}
/// <summary>
/// Handles the ExecuteCode event of the Prepare CodeActivity.
/// </summary>

Просмотреть файл

@ -128,6 +128,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int CreateResourceActorIsNotValueExpressionCondition = 10115;
/// <summary>
/// The event identifier for CreateResource OnSequenceComplete events
/// </summary>
public const int CreateResourceOnSequenceComplete = 10116;
/// <summary>
/// The event identifier for DeleteResources Constructor events
/// </summary>
@ -188,6 +193,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int DeleteResourcesActorIsNotValueExpressionCondition = 10212;
/// <summary>
/// The event identifier for DeleteResources OnSequenceComplete events
/// </summary>
public const int DeleteResourcesOnSequenceComplete = 10213;
/// <summary>
/// The event identifier for GenerateUniqueValue Constructor events
/// </summary>
@ -263,6 +273,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int GenerateUniqueValueRepositionUniquenessKey = 10315;
/// <summary>
/// The event identifier for GenerateUniqueValue OnSequenceComplete events
/// </summary>
public const int GenerateUniqueValueOnSequenceComplete = 10316;
/// <summary>
/// The event identifier for RunPowerShellScript Constructor events
/// </summary>
@ -303,6 +318,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int RunPowerShellScriptActivityExecutionConditionSatisfiedCondition = 10408;
/// <summary>
/// The event identifier for RunPowerShellScript OnSequenceComplete events
/// </summary>
public const int RunPowerShellScriptOnSequenceComplete = 10409;
/// <summary>
/// The event identifier for UpdateResources Constructor events
/// </summary>
@ -368,6 +388,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int UpdateResourcesForEachDynamicStringForResolutionChildCompleted = 10513;
/// <summary>
/// The event identifier for UpdateResources OnSequenceComplete events
/// </summary>
public const int UpdateResourcesOnSequenceComplete = 10514;
/// <summary>
/// The event identifier for VerifyRequest Constructor events
/// </summary>
@ -433,6 +458,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int VerifyRequestActivityExecutionConditionSatisfiedCondition = 10613;
/// <summary>
/// The event identifier for VerifyRequest OnSequenceComplete events
/// </summary>
public const int VerifyRequestOnSequenceComplete = 10614;
/// <summary>
/// The event identifier for AsynchronousCreateResource Constructor events
/// </summary>
@ -1463,6 +1493,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int AddDelayTraceWakeupExecuteCode = 12506;
/// <summary>
/// The event identifier for AddDelay OnSequenceComplete events
/// </summary>
public const int AddDelayOnSequenceComplete = 12507;
/// <summary>
/// The event identifier for SendEmailNotification Constructor events
/// </summary>
@ -1616,6 +1651,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int SendEmailNotificationQueriesHaveNoValueExpressionsCondition = 12630;
/// <summary>
/// The event identifier for SendEmailNotification OnSequenceComplete events
/// </summary>
public const int SendEmailNotificationOnSequenceComplete = 12631;
/// <summary>
/// The event identifier for RequestApproval Constructor events
/// </summary>
@ -1766,6 +1806,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int RequestApprovalFormatRecipient = 12729;
/// <summary>
/// The event identifier for RequestApproval OnSequenceComplete events
/// </summary>
public const int RequestApprovalOnSequenceComplete = 12730;
#endregion
#region "Informational Events"

Просмотреть файл

@ -729,13 +729,13 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
object parameter = this.parameters[0];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDivideInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDivideInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDivideInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDivideInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -795,13 +795,24 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
try
{
bool result;
bool result = false;
if (this.mode != EvaluationMode.Parse)
{
if (this.parameters[0] == null || this.parameters[1] == null)
{
result = this.parameters[0] == null && this.parameters[1] == null;
if (this.parameters[0] == null && this.parameters[1] == null)
{
result = true;
}
else if (this.parameters[0] == null && this.VerifyType(this.parameters[1], typeof(string)))
{
result = string.IsNullOrEmpty(this.parameters[1] as string);
}
else if (this.parameters[1] == null && this.VerifyType(this.parameters[0], typeof(string)))
{
result = string.IsNullOrEmpty(this.parameters[0] as string);
}
}
else if (this.VerifyType(this.parameters[0], typeof(string)) && this.VerifyType(this.parameters[1], typeof(string)))
{
@ -825,10 +836,6 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionEqual, "Eq('{0}', '{1}') evaluated '{2}'.", this.parameters[0], this.parameters[1], result);
}
else
{
result = false;
}
return result;
}
@ -1741,13 +1748,13 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
object parameter = this.parameters[0];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionAddInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionAddInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionAddInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionAddInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -1791,13 +1798,13 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
object parameter = this.parameters[0];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionSubtractInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionSubtractInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionSubtractInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionSubtractInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -1917,6 +1924,8 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionFormatMultivaluedListNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
// Change to accept nulls
/*
// At least one argument to format string function should not be null
bool allArgsNull = true;
for (int i = 1; i < this.parameters.Count; ++i)
@ -1933,6 +1942,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionFormatMultivaluedListNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError2, this.function, 2));
}
*/
object result = null;
@ -1941,12 +1951,16 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
var maxListItemCount = 0;
for (int i = 1; i < this.parameters.Count; ++i)
{
Type paramType = this.parameters[i].GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
parameter = this.parameters[i];
if (parameter != null)
{
var listItemCount = ((IEnumerable)this.parameters[i]).Cast<object>().ToList().Count;
Type paramType = parameter.GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
{
var listItemCount = ((IEnumerable)parameter).Cast<object>().ToList().Count;
maxListItemCount = listItemCount > maxListItemCount ? listItemCount : maxListItemCount;
maxListItemCount = listItemCount > maxListItemCount ? listItemCount : maxListItemCount;
}
}
}
@ -1956,14 +1970,15 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
var args = new object[this.parameters.Count - 1];
for (int i = 1; i < this.parameters.Count; ++i)
{
Type paramType = this.parameters[i].GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
parameter = this.parameters[i];
args[i - 1] = parameter;
if (parameter != null)
{
args[i - 1] = null;
}
else
{
args[i - 1] = this.parameters[i];
Type paramType = parameter.GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
{
args[i - 1] = null;
}
}
}
@ -1979,16 +1994,17 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
{
for (int i = 1; i < this.parameters.Count; ++i)
{
Type paramType = this.parameters[i].GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
parameter = this.parameters[i];
args[i - 1] = parameter;
if (parameter != null)
{
List<object> list = ((IEnumerable)this.parameters[i]).Cast<object>().ToList();
Type paramType = parameter.GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
{
List<object> list = ((IEnumerable)parameter).Cast<object>().ToList();
args[i - 1] = list.Count > n ? list[n] : null;
}
else
{
args[i - 1] = this.parameters[i];
args[i - 1] = list.Count > n ? list[n] : null;
}
}
}
@ -2136,11 +2152,6 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDateTimeAddInvalidFunctionParameterCountError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFunctionParameterCountError, this.function, 2, this.parameters.Count));
}
if (this.parameters[1] == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDateTimeAddNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 2));
}
Type parameterType = typeof(DateTime);
object parameter = this.parameters[0];
if (!this.VerifyType(parameter, parameterType))
@ -2153,7 +2164,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
parameter = this.parameters[1];
if (!this.VerifyType(parameter, parameterType) && !this.VerifyType(parameter, parameterType2))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDateTimeAddInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError3, this.function, parameterType.Name, parameterType2.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDateTimeAddInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError3, this.function, parameterType.Name, parameterType2.Name, parameter == null ? "null" : parameter.GetType().Name));
}
object result;
@ -2166,22 +2177,26 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
}
else
{
if (parameter is TimeSpan)
parameter = this.parameters[1];
if (parameter == null)
{
result = ((DateTime)this.parameters[0]).Add((TimeSpan)this.parameters[1]);
result = (DateTime)this.parameters[0];
}
else if (parameter is TimeSpan)
{
result = ((DateTime)this.parameters[0]).Add((TimeSpan)parameter);
}
else
{
// do additional parameter validation check during execution as it may be a lookup expression than a design-time value.
parameterType = typeof(TimeSpan);
parameter = this.parameters[1];
TimeSpan parseTimeSpan;
if (!TimeSpan.TryParse(parameter as string, out parseTimeSpan))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionDateTimeAddInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError2, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name, parameter));
}
result = ((DateTime)this.parameters[0]).Add(TimeSpan.Parse(this.parameters[1].ToString()));
result = ((DateTime)this.parameters[0]).Add(TimeSpan.Parse(parameter.ToString()));
}
}
@ -2881,7 +2896,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionLeftInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionLeftInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
@ -2931,7 +2946,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionLeftPadInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionLeftPadInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[2];
@ -3120,7 +3135,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMidInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMidInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[2];
@ -3131,7 +3146,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMidInvalidThirdFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidThirdFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMidInvalidThirdFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidThirdFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
@ -3193,13 +3208,13 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
object parameter = this.parameters[0];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionModInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionModInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionModInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionModInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -3250,13 +3265,13 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
object parameter = this.parameters[0];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMultiplyInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMultiplyInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMultiplyInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionMultiplyInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -3506,7 +3521,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRandomNumberInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRandomNumberInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
@ -3517,7 +3532,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRandomNumberInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRandomNumberInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
int result;
@ -3721,7 +3736,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRightInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRightInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
@ -3782,7 +3797,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRightPadInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRightPadInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[2];
@ -4025,7 +4040,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionValueByIndexInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionValueByIndexInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
object result;
@ -4108,7 +4123,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionValueByKeyInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionValueByKeyInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
object result = null;
@ -4135,7 +4150,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
}
else
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionValueByKeyInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionValueByKeyInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
}
@ -4222,7 +4237,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionWordInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionWordInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[2];
@ -4234,7 +4249,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
parameterType = typeof(char);
if (parameter.ToString().ToCharArray().Length != 1)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionWordInvalidThirdFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidThirdFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionWordInvalidThirdFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidThirdFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
@ -4329,7 +4344,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitAndInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitAndInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
@ -4340,7 +4355,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitAndInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitAndInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -4432,7 +4447,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitOrInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitOrInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
parameter = this.parameters[1];
@ -4443,7 +4458,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitOrInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionBitOrInvalidSecondFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidSecondFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
@ -4537,21 +4552,17 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Type parameterType = typeof(string);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertStringToGuidNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertStringToGuidInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertStringToGuidInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
byte[] result;
if (this.mode != EvaluationMode.Parse)
{
result = (new Guid((string)parameter)).ToByteArray();
var input = parameter as string;
result = string.IsNullOrEmpty(input) ? Guid.Empty.ToByteArray() : (new Guid(input)).ToByteArray();
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionConvertStringToGuid, "ConvertStringToGuid('{0}') returned '{1}'.", this.parameters[0], result);
}
@ -4586,21 +4597,17 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Type parameterType = typeof(string);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertFromBase64NullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertFromBase64InvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertFromBase64InvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
byte[] result;
if (this.mode != EvaluationMode.Parse)
{
result = Convert.FromBase64String((string)parameter);
var input = parameter as string;
result = string.IsNullOrEmpty(input) ? null : Convert.FromBase64String(input);
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionConvertFromBase64, "ConvertFromBase64('{0}') returned '{1}'.", this.parameters[0], result);
}
@ -4638,7 +4645,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertNumberToListInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertNumberToListInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
List<int> result = null;
@ -4691,7 +4698,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertSidToStringInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertSidToStringInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
@ -4734,21 +4741,16 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Type parameterType = typeof(byte[]);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToBase64NullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToBase64InvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToBase64InvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
if (this.mode != EvaluationMode.Parse)
{
result = Convert.ToBase64String((byte[])parameter);
result = parameter == null ? null : Convert.ToBase64String((byte[])parameter);
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionConvertToBase64, "ConvertToBase64('{0}') returned '{1}'.", this.parameters[0], result);
}
@ -4822,21 +4824,16 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Type parameterType = typeof(string);
Type parameterType2 = typeof(bool);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToNumberNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
if (!this.VerifyType(parameter, parameterType) && !this.VerifyType(parameter, parameterType2) && !this.VerifyType(parameter, typeof(long)))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToNumberInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError2, this.function, parameterType.Name, parameterType2.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToNumberInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError2, this.function, parameterType.Name, parameterType2.Name, parameter == null ? "null" : parameter.GetType().Name));
}
long result;
if (this.mode != EvaluationMode.Parse)
{
result = Convert.ToInt64(parameter, CultureInfo.InvariantCulture);
result = parameter == null ? 0 : Convert.ToInt64(parameter, CultureInfo.InvariantCulture);
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionConvertToNumber, "ConvertToNumber('{0}') returned '{1}'.", this.parameters[0], result);
}
else
@ -4962,7 +4959,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionEscapeDNComponentInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionEscapeDNComponentInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
string result;
@ -5048,11 +5045,6 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Type parameterType = typeof(string);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionSplitStringNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionSplitStringInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFunctionParameterTypeError, this.function, 1, parameterType.Name, parameter.GetType().Name));
@ -5089,9 +5081,9 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
List<string> result;
if (this.mode != EvaluationMode.Parse)
{
result = !string.IsNullOrEmpty(separator) ? input.Split(new string[] { separator }, count, StringSplitOptions.RemoveEmptyEntries).ToList() : input.Split(default(string[]), count, StringSplitOptions.RemoveEmptyEntries).ToList();
result = string.IsNullOrEmpty(input) ? null : !string.IsNullOrEmpty(separator) ? input.Split(new string[] { separator }, count, StringSplitOptions.RemoveEmptyEntries).ToList() : input.Split(default(string[]), count, StringSplitOptions.RemoveEmptyEntries).ToList();
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionSplitString, "SplitString('{0}', '{1}', '{2}') returned a list with '{3}' items.", input, separator, count, result.Count);
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionSplitString, "SplitString('{0}', '{1}', '{2}') returned a list with '{3}' items.", input, separator, count, result == null ? 0 : result.Count);
}
else
{
@ -5124,14 +5116,9 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Type parameterType = typeof(List<string>);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRemoveDuplicatesNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}
if (!this.VerifyType(parameter, parameterType))
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRemoveDuplicatesInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter.GetType().Name));
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRemoveDuplicatesInvalidFirstFunctionParameterTypeError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFirstFunctionParameterTypeError, this.function, parameterType.Name, parameter == null ? "null" : parameter.GetType().Name));
}
List<string> result;
@ -5139,14 +5126,23 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
if (this.mode != EvaluationMode.Parse)
{
List<string> input = (List<string>)parameter;
result = new List<string>(input.Count);
foreach (string item in input.Where(item => !result.Contains(item, StringComparer.OrdinalIgnoreCase)))
if (input != null)
{
result.Add(item);
}
result = new List<string>(input.Count);
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionRemoveDuplicates, "RemoveDuplicates('{0}') returned a list with '{1}' items removed.", this.parameters[0], input.Count - result.Count);
foreach (string item in input.Where(item => !result.Contains(item, StringComparer.OrdinalIgnoreCase)))
{
result.Add(item);
}
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionRemoveDuplicates, "RemoveDuplicates('{0}') returned a list with '{1}' items removed.", this.parameters[0], input.Count - result.Count);
}
else
{
result = null;
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionRemoveDuplicates, "RemoveDuplicates('{0}') returned null.", this.parameters[0]);
}
}
else
{