Merge pull request #3 from microsoft/master

Merging with Microsoft/MIMWAL
This commit is contained in:
Nilesh Ghodekar 2019-11-25 21:15:45 +00:00 коммит произвёл GitHub
Родитель bf55958b0a 4998e1170d
Коммит b170d7617f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 138 добавлений и 0 удалений

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

@ -7,6 +7,13 @@
NOTE: Edit the Version and PublicKeyToken of the WAL AssemblyName to match the one that you have deployed in GAC. 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. 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() $Error.Clear()

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

@ -1288,6 +1288,16 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary> /// </summary>
public const int ExpressionFunctionMod = 11686; public const int ExpressionFunctionMod = 11686;
/// <summary>
/// The event identifier for ExpressionFunction IndexByValue events
/// </summary>
public const int ExpressionFunctionIndexByValue = 11687;
/// <summary>
/// The event identifier for ExpressionFunction CR events
/// </summary>
public const int ExpressionFunctionCr = 11688;
/// <summary> /// <summary>
/// The event identifier for LookupEvaluator Constructor events /// The event identifier for LookupEvaluator Constructor events
/// </summary> /// </summary>
@ -2748,6 +2758,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary> /// </summary>
public const int ExpressionFunctionCrlfInvalidFunctionParameterCountError = 41658; public const int ExpressionFunctionCrlfInvalidFunctionParameterCountError = 41658;
/// <summary>
/// The event identifier for ExpressionFunction CR events
/// </summary>
public const int ExpressionFunctionCrInvalidFunctionParameterCountError = 41658;
/// <summary> /// <summary>
/// The event identifier for ExpressionFunction EscapeDNComponent events /// The event identifier for ExpressionFunction EscapeDNComponent events
/// </summary> /// </summary>
@ -3178,6 +3193,16 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary> /// </summary>
public const int ExpressionFunctionModInvalidSecondFunctionParameterTypeError = 41686; public const int ExpressionFunctionModInvalidSecondFunctionParameterTypeError = 41686;
/// <summary>
/// The event identifier for ExpressionFunction ValueByIndex events
/// </summary>
public const int ExpressionFunctionIndexByValueInvalidFunctionParameterCountError = 41687;
/// <summary>
/// The event identifier for ExpressionFunction IndexByValue events
/// </summary>
public const int ExpressionFunctionIndexByValueNullFunctionParameterError = 41645;
/// <summary> /// <summary>
/// The event identifier for LookupEvaluator Constructor events /// The event identifier for LookupEvaluator Constructor events
/// </summary> /// </summary>

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

@ -168,6 +168,9 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
case "CREATESQLPARAMETER2": case "CREATESQLPARAMETER2":
return this.CreateSqlParameter2(); return this.CreateSqlParameter2();
case "CR":
return this.CR();
case "CRLF": case "CRLF":
return this.CRLF(); return this.CRLF();
@ -222,6 +225,9 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
case "IIF": case "IIF":
return this.IIF(); return this.IIF();
case "INDEXBYVALUE":
return this.IndexByValue();
case "INSERTVALUES": case "INSERTVALUES":
return this.InsertValues(); return this.InsertValues();
@ -2691,6 +2697,70 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
} }
} }
/// <summary>
/// This function is used to retrieve the index for a specific value within the input list.
/// Function Syntax: IndexByValue(values:[list or object], value:object)
/// </summary>
/// <returns>The index of the specified value in the input list. If the value is not found in the list, null is returned.</returns>
private object IndexByValue()
{
Logger.Instance.WriteMethodEntry(EventIdentifier.ExpressionFunctionIndexByValue, "Evaluation Mode: '{0}'.", this.mode);
try
{
if (this.parameters.Count != 2)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionIndexByValueInvalidFunctionParameterCountError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFunctionParameterCountError, this.function, 2, this.parameters.Count));
}
// default value if no results are found
int result = -1;
if (this.mode != EvaluationMode.Parse)
{
if (this.parameters[0] != null && this.parameters[1] != null)
{
Type paramType = this.parameters[0].GetType();
if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(List<>))
{
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionIndexByValue, "IndexByValue('{0}', '{1}') First parameter is a list. Enumerating list items.", this.parameters[0], this.parameters[1]);
int index = 0;
foreach (object item in (IEnumerable)this.parameters[0])
{
if (item is string && this.parameters[1] is string)
{
if (item.ToString().Equals(this.parameters[1].ToString(), StringComparison.InvariantCultureIgnoreCase))
{
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionIndexByValue, "IndexByValue('{0}', '{1}') Matched string item '{2}' to second param '{3}'. Result: {4}.", this.parameters[0], this.parameters[1], item.ToString(), this.parameters[1].ToString(), index);
result = index;
break;
}
}
else if (item.Equals(this.parameters[1]))
{
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionIndexByValue, "IndexByValue('{0}', '{1}') Matched object item '{2}' to second param '{3}'. Result: {4}.", this.parameters[0], this.parameters[1], item.ToString(), this.parameters[1].ToString(), index);
result = index;
break;
}
index += 1;
}
}
}
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionIndexByValue, "IndexByValue('{0}', '{1}') returned '{2}'.", this.parameters[0], this.parameters[1], result);
}
return result;
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.ExpressionFunctionIndexByValue, "Evaluation Mode: '{0}'.", this.mode);
}
}
/// <summary> /// <summary>
/// This function is used to create a new InsertedValues collection which contains all values from the specified list. /// This function is used to create a new InsertedValues collection which contains all values from the specified list.
/// This InsertedValues collection will be used by the activity so that it can generate update request parameters accordingly. /// This InsertedValues collection will be used by the activity so that it can generate update request parameters accordingly.
@ -4830,6 +4900,42 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
} }
} }
/// <summary>
/// This function is used to generate a Carriage Return.
/// Function Syntax: CR()
/// </summary>
/// <returns>A CR is the output.</returns>
private string CR()
{
Logger.Instance.WriteMethodEntry(EventIdentifier.ExpressionFunctionCr, "Evaluation Mode: '{0}'.", this.mode);
try
{
if (this.parameters.Count != 0)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionCrInvalidFunctionParameterCountError, new InvalidFunctionFormatException(Messages.ExpressionFunction_InvalidFunctionParameterCountError, this.function, 0, this.parameters.Count));
}
string result;
if (this.mode != EvaluationMode.Parse)
{
result = "\n";
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionCr, "CR() returned '{0}'.", result);
}
else
{
result = null;
}
return result;
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.ExpressionFunctionCr, "Evaluation Mode: '{0}'.", this.mode);
}
}
/// <summary> /// <summary>
/// This function is used to generate a Carriage Return/Line Feed. /// This function is used to generate a Carriage Return/Line Feed.
/// Function Syntax: CRLF() /// Function Syntax: CRLF()