// Wrapper code that encapsulates creating a simple message query for the purposes of the sample static MessageQuerySet CreateMessageQuerySet(string query) { XPathMessageQuery xpathQuery = new XPathMessageQuery(query); MessageQuerySet mqs = new MessageQuerySet(); mqs.Add("accountQuery", xpathQuery); return(mqs); }
private static CorrelationQuery CreateDefaultCorrelationQuery(CorrelationQuery query, string action, CorrelationDataDescription data, ref bool shouldPreserveMessage) { XPathMessageQuery query5 = new XPathMessageQuery { Expression = string.Format(CultureInfo.InvariantCulture, "sm:correlation-data('{0}')", new object[] { data.Name }), Namespaces = new XPathMessageContext() }; MessageQuery query2 = query5; if (data.IsOptional) { OptionalMessageQuery query3 = new OptionalMessageQuery { Query = query2 }; query2 = query3; } if (query == null) { MessageFilter filter; bool flag = data.Name == "wsc-instanceId"; if (!shouldPreserveMessage && !flag) { shouldPreserveMessage = true; } if (action == "*") { filter = new MatchAllMessageFilter(); } else { filter = new ActionMessageFilter(new string[] { action }); } CorrelationQuery query4 = new CorrelationQuery { Where = filter, IsDefaultContextQuery = flag }; MessageQuerySet set = new MessageQuerySet(); set.Add(data.Name, query2); query4.Select = set; return(query4); } query.Select[data.Name] = query2; return(query); }
/// <summary> /// Generate the correlation hash /// </summary> /// <returns>MessageQuerySet</returns> private MessageQuerySet CreateCorrelationQuery() { var xpath = new XPathMessageQuery { Namespaces = new XmlNamespaceManager(new NameTable()), Expression = "//sample:WorkflowId" }; xpath.Namespaces.AddNamespace("sample", MessageNamespace); var messageQuerySet = new MessageQuerySet { Name = "RequestCorrelation" }; messageQuerySet.Add("WorkflowId", xpath); return(messageQuerySet); }
// Wrapper code that encapsulates creating a simple message query for the purposes of the sample static MessageQuerySet CreateMessageQuerySet(string query) { XPathMessageQuery xpathQuery = new XPathMessageQuery(query); MessageQuerySet mqs = new MessageQuerySet(); mqs.Add("accountQuery", xpathQuery); return mqs; }