SDM: Flow and Extends questions

Hi,

While working with SDM SDK, I’ve encountered two problems that I cannot resolve.

  1. I am trying to use inheritance in the following manner: I defined application-layer systemA with propertyP1, and then I defined systemB that inherits from systemA (<SystemDefinition Name="B" Layer="Application" Extends="A" Abstract="true">).

When I add systemB to my AD model I don’t see propertyP1 in “Setting & Constraints” tab, but when I add systemA I am able to see its property. Interestingly enough when I’m defining the same property within systemB boundaries, compiler complains that it’s already defined in the super-system, so it clearly recognizes the inheritance.

  1. I am trying to use System.Flow:Copy to copy some properties from a provider endpoint to the connected consumer endpoint and I am doing it within<CommunicationDefinition> tag. But unfortunately nothing happens. I followed the SDK examples, but I couldn’t make FLOW work in them either.

Could anybody explain when flow definition is triggered for the cases where it is defined within the following tags:SystemDefinition,CommunicationDefinition and HostingDefinition

Any ideas?

Nel

[5098 byte] By [NelK] at [2008-2-2]
# 1
Hi Nel,
I've forwarded this post to the product team. You should see a response soon.
ElonaTuomiMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Architecture & Design...
# 2

Hi Nel...

For Whitehorse V1, our designers do not support inheritance with Systems, only with resources. However, the SDM Compiler does support them. So even though you can't see them in the Settings And Constraints Editor (S&CE), they are there when you would validate/generate deployment report.

W.r.t. the Flow: Flow happens only in the memory of the compiler. It is not propagated back into the S&CE. The only place where you can see the result of the flow is in the Deployment Report which can be considered to be like a 'memory dump' after flows, constraints, etc. So when looking for a flowed value, you will need to look in the Deployment Report

Just as a brief walkthrough, this is another example of a very simple flow:
<SystemDefinitionModel Name="Flows" Version="1.0.0.0" DocumentLanguage="en" xmlns="http://schemas.microsoft.com/SystemDefinitionModel/2005/1">
<Import Alias="System" Name="System" />
<Import Alias="GH" Name="Microsoft.GenericHost" />
<Import Alias="Flow" Name="System.Flow" />

<EndpointDefinition Name="ServerEndpoint" Layer="ApplicationHost" Abstract="true">
<DesignData>
<VisualStudio xmlns="
http://schemas.microsoft.com/SystemDefinitionModel/2005/1/DesignData/VisualStudio">
<ModelElement>
<Property Name="PrimaryRelationshipName" Value="HostingDefinition" />
<Property Name="PrimaryRelationshipRole" Value="Host" />
<Property Name="DefaultRootName" Value="ClientEndpoint1" />
<Property Name="ThemeColor" Value="123, 45, 67" />
<Property Name="Geometry" Value="General" />
</ModelElement>
</VisualStudio>
</DesignData>

<SettingDeclaration Name="Address" Definition="System:String" CanBeNull="false" />
</EndpointDefinition>

<EndpointDefinition Name="ClientEndpoint" Layer="ApplicationHost" Abstract="true">
<DesignData>
<VisualStudio xmlns="
http://schemas.microsoft.com/SystemDefinitionModel/2005/1/DesignData/VisualStudio">
<ModelElement>
<Property Name="PrimaryRelationshipName" Value="HostingDefinition" />
<Property Name="PrimaryRelationshipRole" Value="Host" />
<Property Name="DefaultRootName" Value="ClientEndpoint1" />
<Property Name="Direction" Value="Client" />
<Property Name="ThemeColor" Value="123, 56, 67" />
<Property Name="Geometry" Value="General" />
</ModelElement>
</VisualStudio>
</DesignData>

<SettingDeclaration Name="IAmTalkingTo" Definition="System:String" CanBeNull="true" />
</EndpointDefinition>

<ContainmentDefinition Name="GHcontainsServerEndpoint" ParentDefinition="GH:GenericServer" MemberDefinition="ServerEndpoint" />
<ContainmentDefinition Name="GHcontainsClientEndpoint" ParentDefinition="GH:GenericServer" MemberDefinition="ClientEndpoint" />

<CommunicationDefinition Name="ServerTalksToClient" ServerDefinition="ServerEndpoint" ClientDefinition="ClientEndpoint">
<Flow Name="FillOutTheBlanks" Definition="Flow:Copy">
<Input Name="Source" Path="Server.Address" />
<Output Name="Destination" Path="Client.IAmTalkingTo" Cast="true" />
</Flow>
</CommunicationDefinition>
</SystemDefinitionModel>

So basically what we have is this: I created two endpoints (server and client) to be contained on the Microsoft.GenericHost:GenericServer. Then I define a CommunicationDefinition between them and WITHIN that CommunicationDefinition (in other words, every time they communicate or for ever connection between a ServerEndpoint and ClientEndpoint) I defined a Flow ('FillOutTheBlanks') that is defined by System.Flow:Copy.

As Source (the input); I use information I get from the relationship I am defining this flow in (namely the CommunicationDefinition). This relationship has two actors: [Server] and [Client] (or if this would be a ContainmentDefinition [Member] and [Parent]; if it was a HostingDefinition it would be [Host] and [Guest] and similar for other types of relationships); so I use these actors to access their SettingDeclaration:
Server.Address (defined in the ServerDefinition of the CommunicationDefinition, namely 'ServerEndpoint') and Client.IAmTalkingTo (defined in the ClientDefinition of the CommunicationDefinition, namely 'ClientEndpoint').
As Destination (the output); I use the Client's Setting named 'IAmTalkingTo'.

So to use this flow and see it in action these are the repro steps:

  1. Compile the SDM File; generate the prototypes and register all files in the registry
  2. Create a Logical Datacenter Diagram with two GenericServers; delete their default endpoints
  3. Add a [ServerEndpoint] to one of the Logical Servers and a [ClientEndpoint] to the other Logical Server
  4. Connect these endpoints
  5. In the [ServerEndpoint]'s Settings & Constraints Editor, set the value of 'Address' to any value you like (i.e. "One Microsoft Way, Redmond WA, USA" :) )
  6. Add an Distibuted Systems Designer and add two GenericApplications to it
  7. Right-click on the designer and select 'define deployment' and deploy to the existing Logicl Datacenter Designer
  8. Map the GenericApplications to each server (one each)
  9. Right-click on the Deployment Designer and select 'Generate Deployment Report'

After the deployment report is generated; you can open the generated HTML file in the browser and on both endpoints, you'll see the value you entered for 'Address' (even though entered only once in the Settings and Constraints Editor). So in fact, the value flowed from the ServerEndpoint to the ClientEndpoint. (you'll also find this value in the XML Deployment Report)

Hope this helps :)

ThomasDelrue at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Architecture & Design...
# 3

Hi Thomas,

Thanks, it certainly helps.
Do you envision that the next version will support rendering of inherited properties?
Do you consider current Flow behavior to be limited and will it possible in the future to execute flow clauses within the context of a single diagram (e.g. AD)?

Thanks again,
Nel

NelK at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Architecture & Design...
# 4

Hey,

Currently, the SDM Compiler allows flows over any kind of relationship (ContainmentDefinition, HostingDefinition, CommunicationDefinition, ReferenceDefinition && DelegationDefinition). The demo above is actually a flow on the same layer (LDD), but if those endpoints would have been contained on different layers, the values would have flown on that layer.

However, you could for instance also create a flow within a HostingDefinition, thus allowing values to flow from layer to layer (SD to LDD or vice versa).

It depends on the scenario; in a scenario in which a logical IIS contains its hostname, it is indeed very plausible to create a flow that flows from the IIS (which contains the HostName - say www.microsoft.com) to the hosted WebApp (say \technet) in order to store it's full path (flowing www.microsoft.com and \technet towards a new setting on the WebApp called 'URI' which will then have value www.microsoft.com\technet)

ThomasDelrue at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Architecture & Design...

Visual Studio Team System

Site Classified