BTDF / DeploymentFramework

The Deployment Framework for BizTalk is the most powerful and customizable, yet easy-to-use toolkit for deploying and configuring your BizTalk solutions.
MIT License
53 stars 24 forks source link

Issue: Send port names are not updated in PartyCollection when EnableSideBySide is True #343

Open tfabraham opened 6 years ago

tfabraham commented 6 years ago

When one uses the feature, the Send port references in the of the binding file are not updated to be version specific, like all other send ports.

In all other places my send ports get the prefix: {projectname}{projectversion} but not in the PartyCollection.

This work item was migrated from CodePlex

CodePlex work item ID: '10658' Vote count: '1'

tfabraham commented 6 years ago

[2nice@6/18/2014] I believe that this should be added to PrependToBindingPortNames task's execute method, since the sendports in the party collection are marked up a little different:

this.Log.LogMessage(MessageImportance.Normal, "Prepending '{0}' to SendPortReference names in parties...", _stringToPrepend);
nodesToUpdate = bindingDoc.SelectNodes("//SendPortReference/name");

UpdatePortRefs(nodesToUpdate, PortType.Send, bindingDoc);

Regards, Bo.

tfabraham commented 6 years ago

[tfabraham@6/18/2014] That was my assumption as well, thanks!

tfabraham commented 6 years ago

[2nice@6/19/2014] This temporary fix works for me. Not sure if its a general fix. In execute method add:

this.Log.LogMessage(MessageImportance.Normal, "Prepending '{0}' to SendPortReference names in parties...", _stringToPrepend);

nodesToUpdate = bindingDoc.SelectNodes("//*[local-name()='SendPortReference']/*[local-name()='Name']");
            UpdatePartyPortReferences(nodesToUpdate, bindingDoc);

and add the followring private method:

private void UpdatePartyPortReferences(XmlNodeList nodesToUpdate, XmlDocument bindingDoc)
        {
            foreach (XmlElement nodeToUpdate in nodesToUpdate)
            {
                XmlNode portDefinition =
                        bindingDoc.SelectSingleNode(string.Format("//SendPort[@Name='{0}']", nodeToUpdate.InnerText));

                // only sendports in parties                
                // check if it's used

                if (portDefinition != null)
                {
                    nodeToUpdate.InnerText = string.Format("{0}_{1}", _stringToPrepend, nodeToUpdate.InnerText);                
                }
            }
        }