Merge pull request #10 from NileshGhodekar/master

Resolve Dynamic Grammar capability
This commit is contained in:
Nilesh Ghodekar 2016-03-14 15:00:25 +00:00
Родитель e4afc31aba 890a24c3e8
Коммит 0c13d77cd9
8 изменённых файлов: 402 добавлений и 65 удалений

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

@ -22,7 +22,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string Version = "2.16.0305.0";
internal const string Version = "2.16.0313.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.16.0305.0";
internal const string FileVersion = "2.16.0313.0";
}
}

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

@ -1446,6 +1446,24 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI {
}
}
/// <summary>
/// Looks up a localized string similar to Resolve Dynamic Grammar.
/// </summary>
internal static string ResolveDynamicGrammar {
get {
return ResourceManager.GetString("ResolveDynamicGrammar", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The activity can be configured to resolve / evaluate lookups and expressions in the values returned by lookups in update definitions. Example: [//Queries/EmailTemplate/EmailBody] string will be parsed and all lookups will be resolved..
/// </summary>
internal static string ResolveDynamicGrammarHelpText {
get {
return ResourceManager.GetString("ResolveDynamicGrammarHelpText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Resolve From Expression.
/// </summary>

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

@ -801,4 +801,10 @@
<data name="ActivityExecutionConditionValidationError" xml:space="preserve">
<value>The activity execution condition must be a boolean function. Consider wrapping your current condition inside a ConvertToBoolean() function.</value>
</data>
<data name="ResolveDynamicGrammar" xml:space="preserve">
<value>Resolve Dynamic Grammar</value>
</data>
<data name="ResolveDynamicGrammarHelpText" xml:space="preserve">
<value>The activity can be configured to resolve / evaluate lookups and expressions in the values returned by the expressions in update definitions. Example: The string returned by [//Queries/EmailTemplate/EmailBody] will be parsed and all lookups will be resolved.</value>
</data>
</root>

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

@ -68,6 +68,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI.Forms
/// </summary>
private readonly ActivityCheckBox applyAuthorizationPolicy;
/// <summary>
/// The resolve dynamic grammar checkbox
/// </summary>
private readonly ActivityCheckBox resolveDynamicGrammar;
/// <summary>
/// The activity execution condition textbox
/// </summary>
@ -147,6 +152,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI.Forms
this.actorString = this.controller.AddTextBox(ActivitySettings.ActorString, false, false);
this.applyAuthorizationPolicy = this.controller.AddCheckBox(ActivitySettings.ApplyAuthorizationPolicy, ActivitySettings.ApplyAuthorizationPolicyHelpText, false, false);
this.resolveDynamicGrammar = this.controller.AddCheckBox(ActivitySettings.ResolveDynamicGrammar, ActivitySettings.ResolveDynamicGrammarHelpText, false, false);
// Create a new definitions controller to capture update definitions
this.updates = new DefinitionsController("Updates", 330, 250, 70)
@ -211,7 +217,8 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI.Forms
Iteration = this.iteration.Value,
ActorType = GetActorType(this.actorType.Value),
ActorString = this.actorString.Value,
ApplyAuthorizationPolicy = this.applyAuthorizationPolicy.Value
ApplyAuthorizationPolicy = this.applyAuthorizationPolicy.Value,
ResolveDynamicGrammar = this.resolveDynamicGrammar.Value
};
// Convert the definition listings (web controls) to hash tables which can be serialized to the XOML workflow definition
@ -260,6 +267,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI.Forms
this.actorType.Value = wfa.ActorType.ToString();
this.actorString.Value = wfa.ActorString;
this.applyAuthorizationPolicy.Value = wfa.ApplyAuthorizationPolicy;
this.resolveDynamicGrammar.Value = wfa.ResolveDynamicGrammar;
this.queries.LoadActivitySettings(wfa.QueriesTable);
this.updates.LoadActivitySettings(wfa.UpdatesTable);
}
@ -658,6 +666,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.UI.Forms
this.iteration.Visible = this.advanced.Value;
this.actorType.Visible = this.advanced.Value;
this.applyAuthorizationPolicy.Visible = this.advanced.Value;
this.resolveDynamicGrammar.Visible = this.advanced.Value;
if (!this.advanced.Value)
{

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

@ -31,6 +31,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
System.Workflow.ComponentModel.ActivityBind activitybind3 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind4 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind5 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.Activities.CodeCondition codecondition1 = new System.Workflow.Activities.CodeCondition();
System.Workflow.ComponentModel.ActivityBind activitybind6 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind7 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind8 = new System.Workflow.ComponentModel.ActivityBind();
@ -41,15 +42,26 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
System.Workflow.ComponentModel.ActivityBind activitybind13 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind14 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind15 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.Activities.CodeCondition codecondition1 = new System.Workflow.Activities.CodeCondition();
System.Workflow.Activities.CodeCondition codecondition2 = new System.Workflow.Activities.CodeCondition();
System.Workflow.ComponentModel.ActivityBind activitybind16 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind17 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind18 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind19 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind20 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.Activities.CodeCondition codecondition2 = new System.Workflow.Activities.CodeCondition();
System.Workflow.Activities.CodeCondition codecondition3 = new System.Workflow.Activities.CodeCondition();
System.Workflow.ComponentModel.ActivityBind activitybind21 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind22 = new System.Workflow.ComponentModel.ActivityBind();
System.Workflow.ComponentModel.ActivityBind activitybind23 = new System.Workflow.ComponentModel.ActivityBind();
System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<System.Guid>> dictionary_21 = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<System.Guid>>();
this.ResolveDynamicLookupString = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookupString();
this.ForEachDynamicStringForResolution = new System.Workflow.Activities.ReplicatorActivity();
this.ResolveDynamicExpression = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups();
this.PrepareDynamicGrammarResolution = new System.Workflow.Activities.CodeActivity();
this.DynamicGrammarResolutionNeed = new System.Workflow.Activities.IfElseBranchActivity();
this.Update = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups();
this.GetActorForChildRequest = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor();
this.PrepareUpdate = new System.Workflow.Activities.CodeActivity();
this.IfDynamicGrammarResolutionNeed = new System.Workflow.Activities.IfElseActivity();
this.ResolveForValue = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups();
this.GetActor = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor();
this.Submit = new System.Workflow.Activities.SequenceActivity();
@ -61,79 +73,136 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
this.RunQueries = new MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveQueries();
this.Prepare = new System.Workflow.Activities.CodeActivity();
//
// Update
// ResolveDynamicLookupString
//
activitybind1.Name = "GetActorForChildRequest";
activitybind1.Path = "Actor";
this.ResolveDynamicLookupString.ComparedRequestId = new System.Guid("00000000-0000-0000-0000-000000000000");
this.ResolveDynamicLookupString.Name = "ResolveDynamicLookupString";
activitybind1.Name = "RunQueries";
activitybind1.Path = "QueryResults";
this.ResolveDynamicLookupString.Resolved = null;
this.ResolveDynamicLookupString.ResolvedList = null;
this.ResolveDynamicLookupString.StringForResolution = null;
activitybind2.Name = "UpdateResources";
activitybind2.Path = "ApplyAuthorizationPolicy";
this.Update.Name = "Update";
activitybind3.Name = "RunQueries";
activitybind3.Path = "QueryResults";
activitybind2.Path = "Value";
this.ResolveDynamicLookupString.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookupString.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind2)));
this.ResolveDynamicLookupString.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookupString.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
activitybind3.Name = "UpdateResources";
activitybind3.Path = "DynamicStringsForResolution";
//
// ForEachDynamicStringForResolution
//
this.ForEachDynamicStringForResolution.Activities.Add(this.ResolveDynamicLookupString);
this.ForEachDynamicStringForResolution.ExecutionType = System.Workflow.Activities.ExecutionType.Sequence;
this.ForEachDynamicStringForResolution.Name = "ForEachDynamicStringForResolution";
this.ForEachDynamicStringForResolution.ChildInitialized += new System.EventHandler<System.Workflow.Activities.ReplicatorChildEventArgs>(this.ForEachDynamicStringForResolution_ChildInitialized);
this.ForEachDynamicStringForResolution.ChildCompleted += new System.EventHandler<System.Workflow.Activities.ReplicatorChildEventArgs>(this.ForEachDynamicStringForResolution_ChildCompleted);
this.ForEachDynamicStringForResolution.SetBinding(System.Workflow.Activities.ReplicatorActivity.InitialChildDataProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind3)));
//
// ResolveDynamicExpression
//
this.ResolveDynamicExpression.ComparedRequestId = new System.Guid("00000000-0000-0000-0000-000000000000");
activitybind4.Name = "UpdateResources";
activitybind4.Path = "LookupUpdates";
activitybind4.Path = "ActivityExpressionEvaluator.LookupCache";
this.ResolveDynamicExpression.Name = "ResolveDynamicExpression";
activitybind5.Name = "UpdateResources";
activitybind5.Path = "Value";
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind3)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.UpdateLookupDefinitionsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind4)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.ActorProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind5)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.ApplyAuthorizationPolicyProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind2)));
this.ResolveDynamicExpression.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.LookupsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind4)));
this.ResolveDynamicExpression.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
this.ResolveDynamicExpression.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind5)));
//
// PrepareDynamicGrammarResolution
//
this.PrepareDynamicGrammarResolution.Name = "PrepareDynamicGrammarResolution";
this.PrepareDynamicGrammarResolution.ExecuteCode += new System.EventHandler(this.PrepareDynamicGrammarResolution_ExecuteCode);
//
// DynamicGrammarResolutionNeed
//
this.DynamicGrammarResolutionNeed.Activities.Add(this.PrepareDynamicGrammarResolution);
this.DynamicGrammarResolutionNeed.Activities.Add(this.ResolveDynamicExpression);
this.DynamicGrammarResolutionNeed.Activities.Add(this.ForEachDynamicStringForResolution);
codecondition1.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.DynamicGrammarResolutionNeed_Condition);
this.DynamicGrammarResolutionNeed.Condition = codecondition1;
this.DynamicGrammarResolutionNeed.Name = "DynamicGrammarResolutionNeed";
//
// Update
//
activitybind6.Name = "GetActorForChildRequest";
activitybind6.Path = "Actor";
activitybind7.Name = "UpdateResources";
activitybind7.Path = "ApplyAuthorizationPolicy";
this.Update.Name = "Update";
activitybind8.Name = "RunQueries";
activitybind8.Path = "QueryResults";
activitybind9.Name = "UpdateResources";
activitybind9.Path = "LookupUpdates";
activitybind10.Name = "UpdateResources";
activitybind10.Path = "Value";
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind8)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.UpdateLookupDefinitionsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind9)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.ActorProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind6)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind10)));
this.Update.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.UpdateLookups.ApplyAuthorizationPolicyProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind7)));
//
// GetActorForChildRequest
//
activitybind6.Name = "GetActor";
activitybind6.Path = "Actor";
activitybind7.Name = "UpdateResources";
activitybind7.Path = "ActorString";
activitybind8.Name = "UpdateResources";
activitybind8.Path = "ActorType";
activitybind11.Name = "GetActor";
activitybind11.Path = "Actor";
activitybind12.Name = "UpdateResources";
activitybind12.Path = "ActorString";
activitybind13.Name = "UpdateResources";
activitybind13.Path = "ActorType";
this.GetActorForChildRequest.Name = "GetActorForChildRequest";
activitybind9.Name = "RunQueries";
activitybind9.Path = "QueryResults";
activitybind10.Name = "UpdateResources";
activitybind10.Path = "Value";
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind9)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorStringProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind7)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorTypeProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind8)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind6)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind10)));
activitybind14.Name = "RunQueries";
activitybind14.Path = "QueryResults";
activitybind15.Name = "UpdateResources";
activitybind15.Path = "Value";
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind14)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorStringProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind12)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorTypeProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind13)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind11)));
this.GetActorForChildRequest.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind15)));
//
// PrepareUpdate
//
this.PrepareUpdate.Name = "PrepareUpdate";
this.PrepareUpdate.ExecuteCode += new System.EventHandler(this.PrepareUpdate_ExecuteCode);
//
// IfDynamicGrammarResolutionNeed
//
this.IfDynamicGrammarResolutionNeed.Activities.Add(this.DynamicGrammarResolutionNeed);
this.IfDynamicGrammarResolutionNeed.Name = "IfDynamicGrammarResolutionNeed";
//
// ResolveForValue
//
this.ResolveForValue.ComparedRequestId = new System.Guid("00000000-0000-0000-0000-000000000000");
activitybind11.Name = "UpdateResources";
activitybind11.Path = "ValueExpressions";
activitybind16.Name = "UpdateResources";
activitybind16.Path = "ValueExpressions";
this.ResolveForValue.Name = "ResolveForValue";
this.ResolveForValue.QueryResults = null;
activitybind12.Name = "UpdateResources";
activitybind12.Path = "Value";
this.ResolveForValue.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.LookupsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind11)));
this.ResolveForValue.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind12)));
activitybind17.Name = "UpdateResources";
activitybind17.Path = "Value";
this.ResolveForValue.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.LookupsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind16)));
this.ResolveForValue.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind17)));
//
// GetActor
//
this.GetActor.Actor = new System.Guid("00000000-0000-0000-0000-000000000000");
activitybind13.Name = "UpdateResources";
activitybind13.Path = "ActorString";
activitybind14.Name = "UpdateResources";
activitybind14.Path = "ActorType";
activitybind18.Name = "UpdateResources";
activitybind18.Path = "ActorString";
activitybind19.Name = "UpdateResources";
activitybind19.Path = "ActorType";
this.GetActor.Name = "GetActor";
activitybind15.Name = "RunQueries";
activitybind15.Path = "QueryResults";
activitybind20.Name = "RunQueries";
activitybind20.Path = "QueryResults";
this.GetActor.Value = null;
this.GetActor.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind15)));
this.GetActor.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorStringProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind13)));
this.GetActor.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorTypeProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind14)));
this.GetActor.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind20)));
this.GetActor.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorStringProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind18)));
this.GetActor.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.DetermineActor.ActorTypeProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind19)));
//
// Submit
//
this.Submit.Activities.Add(this.ResolveForValue);
this.Submit.Activities.Add(this.IfDynamicGrammarResolutionNeed);
this.Submit.Activities.Add(this.PrepareUpdate);
this.Submit.Activities.Add(this.GetActorForChildRequest);
this.Submit.Activities.Add(this.Update);
@ -142,8 +211,8 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
// ActorIsNotValueExpression
//
this.ActorIsNotValueExpression.Activities.Add(this.GetActor);
codecondition1.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.ActorIsNotValueExpression_Condition);
this.ActorIsNotValueExpression.Condition = codecondition1;
codecondition2.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.ActorIsNotValueExpression_Condition);
this.ActorIsNotValueExpression.Condition = codecondition2;
this.ActorIsNotValueExpression.Name = "ActorIsNotValueExpression";
//
// ForEachIteration
@ -151,8 +220,8 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
this.ForEachIteration.Activities.Add(this.Submit);
this.ForEachIteration.ExecutionType = System.Workflow.Activities.ExecutionType.Sequence;
this.ForEachIteration.Name = "ForEachIteration";
codecondition2.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.ForEachIteration_UntilCondition);
this.ForEachIteration.UntilCondition = codecondition2;
codecondition3.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.ForEachIteration_UntilCondition);
this.ForEachIteration.UntilCondition = codecondition3;
this.ForEachIteration.ChildInitialized += new System.EventHandler<System.Workflow.Activities.ReplicatorChildEventArgs>(this.ForEachIteration_ChildInitialized);
this.ForEachIteration.ChildCompleted += new System.EventHandler<System.Workflow.Activities.ReplicatorChildEventArgs>(this.ForEachIteration_ChildCompleted);
//
@ -169,22 +238,22 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
// Resolve
//
this.Resolve.ComparedRequestId = new System.Guid("00000000-0000-0000-0000-000000000000");
activitybind16.Name = "UpdateResources";
activitybind16.Path = "ActivityExpressionEvaluator.LookupCache";
activitybind21.Name = "UpdateResources";
activitybind21.Path = "ActivityExpressionEvaluator.LookupCache";
this.Resolve.Name = "Resolve";
activitybind17.Name = "RunQueries";
activitybind17.Path = "QueryResults";
activitybind22.Name = "RunQueries";
activitybind22.Path = "QueryResults";
this.Resolve.Value = null;
this.Resolve.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind17)));
this.Resolve.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.LookupsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind16)));
this.Resolve.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.QueryResultsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind22)));
this.Resolve.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveLookups.LookupsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind21)));
//
// RunQueries
//
this.RunQueries.Name = "RunQueries";
activitybind18.Name = "UpdateResources";
activitybind18.Path = "Queries";
activitybind23.Name = "UpdateResources";
activitybind23.Path = "Queries";
this.RunQueries.QueryResults = dictionary_21;
this.RunQueries.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveQueries.QueryDefinitionsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind18)));
this.RunQueries.SetBinding(MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities.ResolveQueries.QueryDefinitionsProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind23)));
//
// Prepare
//
@ -286,6 +355,12 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
#endregion
private CodeActivity PrepareDynamicGrammarResolution;
private ComponentActivities.ResolveLookupString ResolveDynamicLookupString;
private ReplicatorActivity ForEachDynamicStringForResolution;
private IfElseBranchActivity DynamicGrammarResolutionNeed;
private IfElseActivity IfDynamicGrammarResolutionNeed;
private ComponentActivities.ResolveLookups ResolveDynamicExpression;
private ComponentActivities.DetermineActor GetActorForChildRequest;
private IfElseBranchActivity ActorIsNotValueExpression;
private IfElseActivity IfActorIsNotValueExpression;

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

@ -23,6 +23,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
using System.Workflow.ComponentModel;
using Microsoft.ResourceManagement.WebServices.WSResourceManagement;
using MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common;
using MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.ComponentActivities;
using MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Definitions;
using MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Enumerations;
@ -75,6 +76,10 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
public static DependencyProperty ApplyAuthorizationPolicyProperty =
DependencyProperty.Register("ApplyAuthorizationPolicy", typeof(bool), typeof(UpdateResources));
[SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible", Justification = "DependencyProperty")]
public static DependencyProperty ResolveDynamicGrammarProperty =
DependencyProperty.Register("ResolveDynamicGrammar", typeof(bool), typeof(UpdateResources));
#endregion
#region Declarations
@ -116,6 +121,13 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. VS designer renders public properties as dependency property.")]
public Dictionary<string, object> ValueExpressions;
/// <summary>
/// The Dynamic Strings for Resolution
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "Reviewed. VS designer renders public properties as dependency property.")]
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. VS designer renders public properties as dependency property.")]
public List<string> DynamicStringsForResolution = new List<string>();
/// <summary>
/// The update definitions
/// </summary>
@ -374,6 +386,26 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Gets or sets a value indicating whether to apply authorization policy.
/// </summary>
[Description("Resolve Dynamic Grammar such as [//Queries/EmailTemplate/EmailSubject] or proper replacement of EvaluateExpression")]
[Category("Settings")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool ResolveDynamicGrammar
{
get
{
return (bool)this.GetValue(ResolveDynamicGrammarProperty);
}
set
{
this.SetValue(ResolveDynamicGrammarProperty, value);
}
}
#endregion
#region Methods
@ -428,6 +460,7 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
this.Iteration = null;
this.ActorType = ActorType.Service;
this.ApplyAuthorizationPolicy = false;
this.ResolveDynamicGrammar = false;
}
// If the activity is configured to query for resources,
@ -573,6 +606,14 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
{
var variableCache = this.ActivityExpressionEvaluator.VariableCache;
this.breakIteration = Convert.ToBoolean(variableCache[ExpressionEvaluator.ReservedVariableBreakIteration], CultureInfo.InvariantCulture);
// Reset to the original update definitions as ResolveDynamicGrammar updates the working definitions.
// The If check is really not needed.
if (this.ResolveDynamicGrammar)
{
DefinitionsConverter updatesConverter = new DefinitionsConverter(this.UpdatesTable);
this.updates = updatesConverter.Definitions;
}
}
finally
{
@ -580,6 +621,132 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Handles the ExecuteCode event of the PrepareDynamicResolution CodeActivity.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void PrepareDynamicGrammarResolution_ExecuteCode(object sender, EventArgs e)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.UpdateResourcesForEachDynamicStringForResolutionInitialized);
this.DynamicStringsForResolution = new List<string>(); // clear any previous values
try
{
// Load resolved value expressions to the expression evaluator
foreach (string key in this.ValueExpressions.Keys)
{
this.ActivityExpressionEvaluator.LookupCache[key] = this.ValueExpressions[key];
}
var newUpdates = new List<Definition>();
// Clear the variable cache for the expression evaluator
List<string> variables = this.ActivityExpressionEvaluator.VariableCache.Keys.ToList();
foreach (string variable in variables)
{
this.ActivityExpressionEvaluator.VariableCache[variable] = null;
}
foreach (Definition updateDefinition in this.updates)
{
// Determine if we are targeting a variable
// If so, publish the variable
bool targetVariable = ExpressionEvaluator.DetermineParameterType(updateDefinition.Right) == ParameterType.Variable;
if (targetVariable)
{
object resolved = this.ActivityExpressionEvaluator.ResolveExpression(updateDefinition.Left);
this.ActivityExpressionEvaluator.PublishVariable(updateDefinition.Right, resolved, UpdateMode.Modify);
}
}
foreach (Definition updateDefinition in this.updates)
{
// Resolve the source expression, including any functions or concatenation,
// to retrieve the typed value that should be assigned to the target attribute
object resolved = this.ActivityExpressionEvaluator.ResolveExpression(updateDefinition.Left);
if (resolved is string)
{
string updateDefinitionLeft = resolved as string;
newUpdates.Add(new Definition(updateDefinitionLeft, updateDefinition.Right, updateDefinition.Check));
if (!this.ActivityExpressionEvaluator.ParseIfExpression(updateDefinitionLeft))
{
this.DynamicStringsForResolution.Add(updateDefinitionLeft);
}
}
else
{
newUpdates.Add(updateDefinition);
}
}
this.updates = newUpdates;
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.UpdateResourcesForEachDynamicStringForResolutionInitialized, "DynamicStringsForResolution Count: '{0}'.", this.DynamicStringsForResolution.Count);
}
}
/// <summary>
/// Handles the ChildInitialized event of the ForEachDynamicStringForResolution ReplicatorActivity.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="ReplicatorChildEventArgs"/> instance containing the event data.</param>
private void ForEachDynamicStringForResolution_ChildInitialized(object sender, ReplicatorChildEventArgs e)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.UpdateResourcesForEachDynamicStringForResolutionChildInitialized);
string stringForResolution = e.InstanceData as string;
try
{
ResolveLookupString resolveDynamicLookupString = e.Activity as ResolveLookupString;
if (resolveDynamicLookupString == null || string.IsNullOrEmpty(stringForResolution))
{
return;
}
resolveDynamicLookupString.StringForResolution = stringForResolution;
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.UpdateResourcesForEachDynamicStringForResolutionChildInitialized, "StringForResolution: '{0}'.", stringForResolution);
}
}
/// <summary>
/// Handles the ChildCompleted event of the ForEachDynamicStringForResolution ReplicatorActivity.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="ReplicatorChildEventArgs"/> instance containing the event data.</param>
private void ForEachDynamicStringForResolution_ChildCompleted(object sender, ReplicatorChildEventArgs e)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.UpdateResourcesForEachDynamicStringForResolutionChildCompleted);
string stringForResolution = e.InstanceData as string;
string resolved = null;
try
{
// Using the resolved filter, execute the LDAP query to determine if a conflict exists
ResolveLookupString resolveDynamicLookupString = e.Activity as ResolveLookupString;
if (resolveDynamicLookupString == null || string.IsNullOrEmpty(stringForResolution))
{
return;
}
resolved = resolveDynamicLookupString.Resolved;
// Load resolved value expressions to the expression evaluator
this.ActivityExpressionEvaluator.LookupCache[stringForResolution] = resolved;
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.UpdateResourcesForEachDynamicStringForResolutionChildCompleted, "StringForResolution: '{0}'. Resolved: '{1}'.", stringForResolution, resolved);
}
}
/// <summary>
/// Handles the ExecuteCode event of the PrepareUpdate CodeActivity.
/// </summary>
@ -611,7 +778,17 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
{
// Resolve the source expression, including any functions or concatenation,
// to retrieve the typed value that should be assigned to the target attribute
object resolved = this.ActivityExpressionEvaluator.ResolveExpression(updateDefinition.Left);
object resolved = null;
if (!ExpressionEvaluator.IsExpression(updateDefinition.Left))
{
// This is a dynamic string for resolution already resolved
// so just retrive the value from cache directly
resolved = this.ActivityExpressionEvaluator.LookupCache[updateDefinition.Left];
}
else
{
resolved = this.ActivityExpressionEvaluator.ResolveExpression(updateDefinition.Left);
}
// Determine if we are targeting a variable
// If not, assume we are targeting an expression which should result in requests or update
@ -731,6 +908,25 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Activitie
}
}
/// <summary>
/// Handles the Condition event of the ResolveDynamicGrammar Condition.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="ConditionalEventArgs"/> instance containing the event data.</param>
private void DynamicGrammarResolutionNeed_Condition(object sender, ConditionalEventArgs e)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.UpdateResourcesDynamicGrammarResolutionNeedCondition);
try
{
e.Result = this.ResolveDynamicGrammar;
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.UpdateResourcesDynamicGrammarResolutionNeedCondition, "Condition evaluated '{0}'. Actor String: '{1}'.", e.Result, this.ActorString);
}
}
#endregion Conditions
#endregion

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

@ -348,6 +348,26 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int UpdateResourcesActorIsNotValueExpressionCondition = 10509;
/// <summary>
/// The event identifier for UpdateResources DynamicGrammarResolutionNeed_Condition events
/// </summary>
public const int UpdateResourcesDynamicGrammarResolutionNeedCondition = 10510;
/// <summary>
/// The event identifier for UpdateResources ForEachDynamicStringForResolution_Initialized events
/// </summary>
public const int UpdateResourcesForEachDynamicStringForResolutionInitialized = 10511;
/// <summary>
/// The event identifier for UpdateResources ForEachDynamicStringForResolution_ChildInitialized events
/// </summary>
public const int UpdateResourcesForEachDynamicStringForResolutionChildInitialized = 10512;
/// <summary>
/// The event identifier for UpdateResources ForEachDynamicStringForResolution_ChildCompleted events
/// </summary>
public const int UpdateResourcesForEachDynamicStringForResolutionChildCompleted = 10513;
/// <summary>
/// The event identifier for VerifyRequest Constructor events
/// </summary>
@ -1694,6 +1714,11 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// </summary>
public const int RunPowerShellScriptRunExecuteCodeNullHashtableReturnValueWarning = 30407;
/// <summary>
/// The event identifier for ExpressionEvaluator EvaluateFunction events
/// </summary>
public const int ExpressionEvaluatorEvaluateFunctionDeprecatedFunctionWarning = 31510;
/// <summary>
/// The event identifier for ExpressionFunction Run events
/// </summary>

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

@ -285,21 +285,27 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
/// Parses the expression if it's a valid expression.
/// </summary>
/// <param name="expression">The expression.</param>
public void ParseIfExpression(string expression)
/// <returns>True if the input is a valid expression. Otherwise returns false.</returns>
public bool ParseIfExpression(string expression)
{
Logger.Instance.WriteMethodEntry(EventIdentifier.ExpressionEvaluatorParseIfExpression, "Expression: '{0}'.", expression);
bool isExpression = false;
try
{
if (IsExpression(expression))
isExpression = IsExpression(expression);
if (isExpression)
{
this.ParseExpression(expression);
}
}
finally
{
Logger.Instance.WriteMethodExit(EventIdentifier.ExpressionEvaluatorParseIfExpression, "Expression: '{0}'.", expression);
Logger.Instance.WriteMethodExit(EventIdentifier.ExpressionEvaluatorParseIfExpression, "Expression: '{0}'. IsExpression: {1}.", expression, isExpression);
}
return isExpression;
}
/// <summary>
@ -1020,6 +1026,8 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
// so that it's part of LookupCache.
if (functionName.Equals(ParameterType.EvaluateExpression.ToString(), StringComparison.OrdinalIgnoreCase))
{
Logger.Instance.WriteWarning(EventIdentifier.ExpressionEvaluatorEvaluateFunctionDeprecatedFunctionWarning, Messages.ExpressionFunction_DeprecatedFunctionWarning, ParameterType.EvaluateExpression.ToString(), "Resolve Dynamic Grammar capability of UpdateResources activity");
string expression = this.EvaluateExpression(parameterString, mode) as string; // so e.g. IIF(Eq([//Target/Department],"HR"),"Template1","Template2")
if (mode != EvaluationMode.Parse && !string.IsNullOrEmpty(expression))
{