1
Vote

BizTalk2006.Orchestration.Start is not working with multiple versions of the orchestration

description

If i have the side-by-side orchestrations, and If i want to start v 1.0.0.3 orchestration in Assembly 1.0.0.3, it is not working as expected which is because the assembly name is not used in the start/stop class of Biztalk2006 Orchestration.
Existing Code:
protected override void InternalExecute()
    {
        if (string.IsNullOrEmpty(this.Application))
        {
            base.InternalExecute();
        }
        else
        {
            BtsCatalogExplorer explorer = this.GetBtsCatalogExplorer(this.Server, this.Database);
 
            Application app = explorer.Applications[this.Application];
            if (app != null)
            {
                BtsOrchestration orchestration = app.Orchestrations[this.Name];
                if (orchestration != null)
                {
                    Log.LogMessage(string.Format(CultureInfo.InvariantCulture, "Starting Orchestration: {0} in Application: {1}", this.Name, this.Application));
                    orchestration.Status = OrchestrationStatus.Started;
                    explorer.SaveChanges();
                }
                else
                {
                    Log.LogError(string.Format(CultureInfo.InvariantCulture, "Orchestration not found: {0} for Application {1}", this.Name, this.Application));
                    return;
                }
            }
            else
            {
                Log.LogError(string.Format(CultureInfo.InvariantCulture, "Application not found: {0}", this.Application));
                return;
            }
        }
    }
 
 
We have changed this to take Assembly into consideration, but not only ApplicationName as below. I haven't checked the remaining tasks, but I need Start/Stop classes as my current reuirement.Looking for a fix if there is in the next releases for the remaining tasks.
 
protected override void InternalExecute()
    {
        if (string.IsNullOrEmpty(this.Application))
        {
            base.InternalExecute();
        }
        else
        {
            BtsCatalogExplorer explorer = this.GetBtsCatalogExplorer(this.Server, this.Database);
 
            Application app = explorer.Applications[this.Application];
            if (app != null)
            {
                if (!string.IsNullOrEmpty(this.AssemblyName))
                {
                    foreach (BtsAssembly ASM in app.Assemblies)
                    {
                        if (ASM.DisplayName == this.AssemblyName)
                        {
                            foreach (BtsOrchestration orchestration in ASM.Orchestrations)
                            {
                                if (orchestration.FullName == this.Name)
                                {
                                    orchestration.Status = OrchestrationStatus.Started;
                                    Log.LogMessage(string.Format(CultureInfo.InvariantCulture, "Starting Orchestration: {0} in Assembly {1} in Application: {2}", orchestration.FullName, this.AssemblyName, this.Application));
                                }
                            }
                        }
                    }

                }
                else
                {
                    BtsOrchestration orchestration = app.Orchestrations[this.Name];
                    if (orchestration != null)
                    {
                        Log.LogMessage(string.Format(CultureInfo.InvariantCulture, "Starting Orchestration: {0} in Application: {1}", this.Name, this.Application));
                        orchestration.Status = OrchestrationStatus.Started;
                    }
                    else
                    {
                        Log.LogError(string.Format(CultureInfo.InvariantCulture, "Orchestration not found: {0} for Application {1}", this.Name, this.Application));
                        return;
                    }
                }
                explorer.SaveChanges();
            }
            else
            {
                Log.LogError(string.Format(CultureInfo.InvariantCulture, "Application not found: {0}", this.Application));
                return;
            }
        }
    }

comments