Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Somewhat of an academic challange (but usefull if solved)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Art - 05 Feb 2008 21:46 GMT
This question/problem I'm presenting here is a result of my own struggles to
solve it. I promise you that solution to it will be used by many. Therefore
w/out further due:

Abstracts: BizTalk orchestrations need to be started/stopped/unlisted in
particual order. This happens when orchestrations reference themselves in
linear or tree fashion.

Examples:
- A references B therefore B needs to be stopped before A,
- A references B, B references C AND D therefore C and D need to be stopped
first then B and finally A.

I'm sure you get the picture. So here are rules of the game.
- there can be any number of orchestrations running of a server,
- referencial complexity is arbitrary; X number of orchestrations can
reference one another in any nuber of ways including circular. If circular
dependency is discovered it should to be reported.
- every orchestration (object if you prefer) can provide you with a list of
all other objects it references.

Let's look at an example (this is actual output from one of our
orchestrations trimmed here for brevity):

<RootOrchestration Name="Root">
  <UpstreamOrchestration Name="1.1.1"/>
  <UpstreamOrchestration Name="2.1.2">
     <UpstreamOrchestration Name="3.2.1">
        <UpstreamOrchestration Name="4.3.1"/>
        <UpstreamOrchestration Name="5.3.2">
           <UpstreamOrchestration Name="6.4.1"/>
           <UpstreamOrchestration Name="7.4.2"/>
        </UpstreamOrchestration>
        <UpstreamOrchestration Name="8.3.1">
           <UpstreamOrchestration Name="9.4.1">
              <UpstreamOrchestration Name="10.5.1"/>
              <UpstreamOrchestration Name="11.5.2"/>
           </UpstreamOrchestration>
        </UpstreamOrchestration>
        <UpstreamOrchestration Name="12.3.1"/>
     </UpstreamOrchestration>
 </UpstreamOrchestration>
</RootOrchestration>

First number = sequetial node # counted from the top
Second Number = depth as counted from the root
Third number = sibling order

This numbering convention was estabilished only for illustrative purposes
and to avoid abiguity.

This sample output tells you that before you stop orchestration named "Root"
you have to stop at least 12 z(twelve) other orchestrations in a particular
order. Rules state that you have to stop the child before the parent. So, one
possible solution would be this ("/" means that stop order does not matter
for these objects):

1. 10.5.1 / 11.5.2
2. 9.4.1
3. 12.3.1 / 8.3.1
4. 7.4.2 / 6.4.1
5. 5.3.2 / 4.3.1
6. 3.2.1
7. 2.1.2 / 1.1.1

This only for "Root" object. Remember that there can be any number of
objects/orchestrations running. So, for each of the twelve objects referenced
by the "Root" you have to find out their own relationships before you can
successfully stop "Root".
Jeroen Mostert - 05 Feb 2008 23:18 GMT
> Abstracts: BizTalk orchestrations need to be started/stopped/unlisted in
> particual order. This happens when orchestrations reference themselves in
[quoted text clipped - 4 lines]
> - A references B, B references C AND D therefore C and D need to be stopped
> first then B and finally A.

What you're looking for is called a topological sort on a dependency graph.
It's a classic problem found in many areas.

Signature

J.

Art - 06 Feb 2008 21:53 GMT
This was exaclty what I was looking for. Thanks for your help!

> > Abstracts: BizTalk orchestrations need to be started/stopped/unlisted in
> > particual order. This happens when orchestrations reference themselves in
[quoted text clipped - 7 lines]
> What you're looking for is called a topological sort on a dependency graph.
> It's a classic problem found in many areas.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.