Skip to content

Commit

Permalink
Merge pull request #14 from NileshGhodekar/master
Browse files Browse the repository at this point in the history
The [//Request/RequestParameter] lookup resolution change for a SystemEvent request
  • Loading branch information
NileshGhodekar committed Mar 20, 2016
2 parents 782c521 + 656c46b commit b28ae94
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ All notable changes to MIMWAL project will be documented in this file. The "Unre

------------

### Version 2.16.0320.0

#### Changed

* The `[//Request/RequestParameter]` lookup for a SystemEvent request will resolve to request parameters in the parent request.

------------

### Version 2.16.0315.0

#### Added
Expand Down
4 changes: 2 additions & 2 deletions src/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string Version = "2.16.0315.0";
internal const string Version = "2.16.0320.0";

/// <summary>
/// File Version information for the assembly consists of the following four values:
Expand All @@ -31,6 +31,6 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string FileVersion = "2.16.0315.0";
internal const string FileVersion = "2.16.0320.0";
}
}
2 changes: 1 addition & 1 deletion src/WorkflowActivityLibrary/Common/ExpressionFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public object Run()
/// <typeparam name="T">Type of the object to be deserialized</typeparam>
/// <param name="xml">Serialized representation of the specified type</param>
/// <returns>The Object being deserialized.</returns>
private static T DeserializeObject<T>(string xml)
internal static T DeserializeObject<T>(string xml)
where T : class
{
T t;
Expand Down
31 changes: 29 additions & 2 deletions src/WorkflowActivityLibrary/ComponentActivities/ResolveLookups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ private void ForEachRead_ChildInitialized(object sender, ReplicatorChildEventArg
this.ReadResources = this.resources[this.resourceKey];
this.ReadAttributes = this.reads[this.resourceKey].ToArray();

Logger.Instance.WriteVerbose(EventIdentifier.ResolveLookupsForEachReadChildInitialized, "ResourceKey: '{0}'. Read Attributes: '{1}'.", e.InstanceData, string.Join(",", this.ReadAttributes));
Logger.Instance.WriteVerbose(EventIdentifier.ResolveLookupsForEachReadChildInitialized, "ResourceKey: '{0}'. Read Attributes: '{1}'.", e.InstanceData, string.Join(",", this.ReadAttributes));
}
}
finally
Expand Down Expand Up @@ -813,7 +813,34 @@ private void ForEachResource_ChildCompleted(object sender, ReplicatorChildEventA

foreach (string attribute in this.reads[this.resourceKey].Where(attribute => read.Resource[attribute] != null))
{
this.Publish(string.Format(CultureInfo.InvariantCulture, "{0}/{1}", this.resourceKey, attribute), read.Resource[attribute]);
// If the request is SystemEvent, RequestParameter of Request is published from the parent request.
if (this.resourceKey.Equals(LookupParameter.Request.ToString()) && this.Request.CurrentRequest.Operation == OperationType.SystemEvent && attribute == "RequestParameter")
{
RequestType parentRequest = this.ReadParentRequest.Resource as RequestType;

if (parentRequest != null)
{
IList<string> parentRequestParameters = parentRequest.RequestParameters;
List<string> requestParameters = new List<string>();
if (parentRequestParameters.Count != 0)
{
foreach (string s in parentRequestParameters)
{
RequestParameter parentRequestParameter = ExpressionFunction.DeserializeObject<RequestParameter>(s);
if (parentRequestParameter.Target == this.Request.CurrentRequest.Target)
{
requestParameters.Add(s);
}
}

this.Publish(string.Format(CultureInfo.InvariantCulture, "{0}/{1}", LookupParameter.Request.ToString(), attribute), requestParameters);
}
}
}
else
{
this.Publish(string.Format(CultureInfo.InvariantCulture, "{0}/{1}", this.resourceKey, attribute), read.Resource[attribute]);
}
}
}
finally
Expand Down

0 comments on commit b28ae94

Please sign in to comment.