none
Unbound a set of orchestrations

    Question

  • Hi everybody,

    How can i unbound a set of orchestrations in the same applications with a different method than a right clik => properties.

    I want to unbound them all there is a trick to do that ? maybe using the binding file ?

    Tuesday, March 25, 2014 3:05 PM

Answers

  • You can give a try with Microsoft.BizTalk.ExplorerOM’s BtsCatalogExplorerandBtsOrchestrationCollection class. These classes are generally used to bind the orchestrations. You can explore these class members to remove the port configuration from the Orchestration.

    Reference: http://msdn.microsoft.com/en-us/library/aa547085(v=bts.20).aspx

    Another option is export the binding’s, remove the port bindings from the binding file. And import the updated binding which has not reference to the ports but the host instance to the BizTalk application. This would be the easier way if you want to do these steps every time as part of any of your deployment process. So you can keep this binding handy which has no reference to the Orchestration.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by Aheriz Wednesday, March 26, 2014 10:18 AM
    Tuesday, March 25, 2014 3:39 PM
  • Can you delete and re-deploy your application? if yes then it should be easy to do -

    1. Export current bindings
    2. Create a new binding file by modifying the one you exported to keep only receive and send port collections
    3. Delete application
    4. Re-Deploy application
    5. Import new bindings

    You can avoid step-2 if you already have a new bindings as you mentioned you are going to change the receive and send port names. Make sure to perform first step to have a back up of existing bindings.

    • Marked as answer by Aheriz Wednesday, March 26, 2014 10:18 AM
    Tuesday, March 25, 2014 4:57 PM
  • I have written following powershell script for you.

    You can use this powershell script to unbind all orchestrations in a particular application.

    In this script

    1. set the server name in connection string (if it is local, you can keep it as it is the dot)
    2. replace "TestApp" with your application name
    [void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")
    
    #=== Connect to the BizTalk Management database ===#
    
    $Catalog = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer
    $Catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI"
    
    
    $MyApplication = $Catalog.Applications["TestApp"]
    $MyApplication.Stop(63)
     $Catalog.SaveChanges()
    $orch = $MyApplication.orchestrations
    
    foreach ($CurrentOrchestration in $orch)
    {
        $CurrentOrchestration.Host=$null
        $CurrentOrchestration.Status = [Microsoft.BizTalk.ExplorerOM.OrchestrationStatus] "Enlisted"
        
        $CurrentOrchestration.Status = [Microsoft.BizTalk.ExplorerOM.OrchestrationStatus] "Unenlisted"
        
        
        foreach ($CurrentPort in $CurrentOrchestration.Ports)
            {            
                    $CurrentPort.ReceivePort=$null
                    $CurrentPort.SendPort=$null
             
            }
    
    }
     $Catalog.SaveChanges()

    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    • Edited by Ravindar Thati Wednesday, March 26, 2014 8:21 AM
    • Marked as answer by Aheriz Wednesday, March 26, 2014 10:18 AM
    Wednesday, March 26, 2014 7:54 AM

All replies

  • Why is Unenlisted not enough?

    Is it both the Host- and Port mappings to need to remove?

    Morten la Cour

    Tuesday, March 25, 2014 3:09 PM
  • Only ports.

    Unenlisted it's not enough because i want to delete manually all send ports and receive ports which are bounded to the orchestrations so it's not possible until they are unbound. Then i'll apply a new binding where the name of send ports and receive ports is changed.

    Tuesday, March 25, 2014 3:12 PM
  • You can Remove then Add or Deploy the Orchestration's Assembly.  The Orchestrations will then appear with no Bindings.
    Tuesday, March 25, 2014 3:25 PM
    Moderator
  • You can give a try with Microsoft.BizTalk.ExplorerOM’s BtsCatalogExplorerandBtsOrchestrationCollection class. These classes are generally used to bind the orchestrations. You can explore these class members to remove the port configuration from the Orchestration.

    Reference: http://msdn.microsoft.com/en-us/library/aa547085(v=bts.20).aspx

    Another option is export the binding’s, remove the port bindings from the binding file. And import the updated binding which has not reference to the ports but the host instance to the BizTalk application. This would be the easier way if you want to do these steps every time as part of any of your deployment process. So you can keep this binding handy which has no reference to the Orchestration.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by Aheriz Wednesday, March 26, 2014 10:18 AM
    Tuesday, March 25, 2014 3:39 PM
  • Can you delete and re-deploy your application? if yes then it should be easy to do -

    1. Export current bindings
    2. Create a new binding file by modifying the one you exported to keep only receive and send port collections
    3. Delete application
    4. Re-Deploy application
    5. Import new bindings

    You can avoid step-2 if you already have a new bindings as you mentioned you are going to change the receive and send port names. Make sure to perform first step to have a back up of existing bindings.

    • Marked as answer by Aheriz Wednesday, March 26, 2014 10:18 AM
    Tuesday, March 25, 2014 4:57 PM
  • I have written following powershell script for you.

    You can use this powershell script to unbind all orchestrations in a particular application.

    In this script

    1. set the server name in connection string (if it is local, you can keep it as it is the dot)
    2. replace "TestApp" with your application name
    [void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")
    
    #=== Connect to the BizTalk Management database ===#
    
    $Catalog = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer
    $Catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI"
    
    
    $MyApplication = $Catalog.Applications["TestApp"]
    $MyApplication.Stop(63)
     $Catalog.SaveChanges()
    $orch = $MyApplication.orchestrations
    
    foreach ($CurrentOrchestration in $orch)
    {
        $CurrentOrchestration.Host=$null
        $CurrentOrchestration.Status = [Microsoft.BizTalk.ExplorerOM.OrchestrationStatus] "Enlisted"
        
        $CurrentOrchestration.Status = [Microsoft.BizTalk.ExplorerOM.OrchestrationStatus] "Unenlisted"
        
        
        foreach ($CurrentPort in $CurrentOrchestration.Ports)
            {            
                    $CurrentPort.ReceivePort=$null
                    $CurrentPort.SendPort=$null
             
            }
    
    }
     $Catalog.SaveChanges()

    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    • Edited by Ravindar Thati Wednesday, March 26, 2014 8:21 AM
    • Marked as answer by Aheriz Wednesday, March 26, 2014 10:18 AM
    Wednesday, March 26, 2014 7:54 AM
  • Also if you don't want to use powershell at all, there is another way

    1. when you first deploy your application for the first time, before you bind the orchestrations to physical posrt, export the bindings first. 

    2. when ever you want to unbound all orchestrations, stop the application and then import this binding file. This will unbind the orchestration settings.


    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.



    Wednesday, March 26, 2014 8:31 AM