зеркало из https://github.com/microsoft/MIMWAL.git
Коммит
074c47ee25
109
ChangeLog.md
109
ChangeLog.md
|
@ -8,6 +8,25 @@ All notable changes to MIMWAL project will be documented in this file. The "Unre
|
|||
* Implement Approve Request Activity.
|
||||
* Support for `[//Value]` lookups in Query definitions across rest of the activities.
|
||||
|
||||
------------
|
||||
### 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.
|
||||
|
||||
------------
|
||||
|
||||
### Version 2.18.0318.0
|
||||
|
@ -174,20 +193,88 @@ 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
|
||||
|
|
|
@ -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.18.1110.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.18.1110.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>
|
||||
|
|
|
@ -412,6 +412,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>
|
||||
|
|
|
@ -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>
|
||||
|
@ -1458,6 +1488,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>
|
||||
|
@ -1611,6 +1646,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>
|
||||
|
@ -1761,6 +1801,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"
|
||||
|
|
|
@ -726,13 +726,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;
|
||||
|
@ -792,13 +792,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)))
|
||||
{
|
||||
|
@ -822,10 +833,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;
|
||||
}
|
||||
|
@ -1738,13 +1745,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;
|
||||
|
@ -1788,13 +1795,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;
|
||||
|
@ -1914,6 +1921,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)
|
||||
|
@ -1930,6 +1939,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
|
|||
{
|
||||
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionFormatMultivaluedListNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError2, this.function, 2));
|
||||
}
|
||||
*/
|
||||
|
||||
object result = null;
|
||||
|
||||
|
@ -1938,12 +1948,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1953,14 +1967,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1976,16 +1991,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2133,11 +2149,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))
|
||||
|
@ -2150,7 +2161,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;
|
||||
|
@ -2163,22 +2174,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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2814,7 +2829,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;
|
||||
|
@ -2864,7 +2879,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];
|
||||
|
@ -3053,7 +3068,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];
|
||||
|
@ -3064,7 +3079,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;
|
||||
|
@ -3126,13 +3141,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;
|
||||
|
@ -3183,13 +3198,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;
|
||||
|
@ -3439,7 +3454,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];
|
||||
|
@ -3450,7 +3465,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;
|
||||
|
@ -3654,7 +3669,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;
|
||||
|
@ -3715,7 +3730,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];
|
||||
|
@ -3958,7 +3973,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;
|
||||
|
@ -4041,7 +4056,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;
|
||||
|
@ -4068,7 +4083,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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4155,7 +4170,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];
|
||||
|
@ -4167,7 +4182,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;
|
||||
|
@ -4262,7 +4277,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];
|
||||
|
@ -4273,7 +4288,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;
|
||||
|
@ -4365,7 +4380,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];
|
||||
|
@ -4376,7 +4391,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;
|
||||
|
@ -4470,21 +4485,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);
|
||||
}
|
||||
|
@ -4519,21 +4530,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);
|
||||
}
|
||||
|
@ -4571,7 +4578,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;
|
||||
|
@ -4624,7 +4631,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;
|
||||
|
@ -4667,21 +4674,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);
|
||||
}
|
||||
|
@ -4755,21 +4757,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
|
||||
|
@ -4895,7 +4892,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;
|
||||
|
@ -4981,11 +4978,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));
|
||||
|
@ -5022,9 +5014,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
|
||||
{
|
||||
|
@ -5057,14 +5049,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;
|
||||
|
@ -5072,14 +5059,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
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче