THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Master Data Services Team

Blog for the Microsoft SQL Server Master Data Services (MDS) team. Blog posts are contributed by various team members.

Creating a Bing Map URL with a Business Rule

(this post was contributed by Brian Barnett, Senior Software Engineer on the MDS Team)

While using Bing Maps last night to look for directions I thought of a way to use MDS business rules to create a Bing Map URL link attribute. This may sound like merely a cool thing to try but not very useful. But, I’m going to show a couple of examples of how it could be useful to pique your interest for other possibilities.

Here is the URL format we will need to follow to open Bing Maps to a specific address:

http://bing.com/maps/default.aspx?where1=1%20Microsoft%20Way%20Redmond%20WA%2098052

For more info see the Bing Maps help topic Build your own URL.

I’m going to use the Customer sample model. We’ll need to add a link attribute to the customer entity then create a concatenation business rule to set the value of the link attribute. In this post I’m not giving the step-by-step, detailed instructions to create each item. Please see my Creating a Simple Business Rule and Enabling Human Workflow – Part 1 posts for specific instructions.

Add the link attribute

Add a new Free-form, link attribute to the Customer entity called BingMapURL.  Make sure the data type is Link.

clip_image002

Create the business rule

Now let’s create a rule to populate its value.

  1. Create a new rule and then navigate to the Business Rules Designer page.
  2. In the Components pane, expand the Actions and Change value nodes.
  3. Click the “equals a concatenated value” action and drag it to the THEN pane's Action label.
  4. In the Entity-Specific Attributes pane, click the BingMapURL attribute and drag it to the Edit Action pane's Select attribute label.
  5. In the Entity-Specific Attributes pane, click and drag the following attributes to the “Value” node of the “equals a concatenated value” action.
    1. AddressLine1
    2. City
    3. StateProvince
    4. PostalCode
  6. At this point your Edit Action should look like this

clip_image004

Now let’s add the Bing Map specific URL pieces.

  1. Right click on AddressLine1 attribute and select “Insert text” from the context menu.
  2. Double click the new line and enter this text, without the quotes, “http://bing.com/maps/default.aspx?where1=”.
  3. Right click on the City attribute and select “Insert text” from the context menu.
  4. Double click the new line and enter this text, without the quotes, “%20”.
  5. Repeat steps 3 and 4 for the StateProvince and PostalCode attributes.
  6. Now your Edit Action should look like this.

clip_image006

  1. In the Edit Action pane, click Save. The action will be displayed.

image

  1. Click Back to return to the Business Rule Maintenance page.
  2. Optionally, on the Business Rules Maintenance page, for the row that contains your business rule, double-click a cell in the Name and Description columns to update the value.
  3. Click Publish Business Rules
  4. On the confirmation dialog box, click OK. The rule’s status will change to Active.

Try it out

Add a new customer then return to the Member grid. Scroll over to the right and you will see the populated BingMapURL.

clip_image010

Double click the link icon and then select View from the context menu.

clip_image012

A new browser window opens to the Bing Maps URL.

clip_image014

To prevent users from editing the BingMapURL attribute change the security permissions to Readonly. Other possibilities are to create another link attribute called BingMapDirectionsURL which would be the URL for directions from your company to the customer.

Here’s another example, which I’ll not walk through but simply give you as an idea. What if you have an internal (or external) product catalog website? If you are managing Product data in MDS then you can add a ProductCatalogURL link attribute to the Product entity then follow the same steps we did with the BingMapURL to create it.  The link would be the URL to jump to that product in the catalog.

If you want to take this a little further you could create an ASP.Net web application that utilizes the MDS API. You could create a product list page listing all the products. Each product listing would have a link to the product catalog using the ProductCatalogURL.

There are a lot of possibilities. All it takes is a little creativity.

Published Friday, February 19, 2010 9:07 AM by mattande
Filed under: ,

Comments

 

Arg said:

Very interesting Demo.

Is it possible to provide info on how we can utilize the API through Sharepoint/Biztalk?

Also any example of intiating a workflow through Business Rules?

March 18, 2010 5:35 AM
 

mattande said:

Hi Arg,

We are working on providing more guidance on using MDS with SharePoint and BizTalk but we don’t have anything published/released yet.

We do have a recent MSDN article on SharePoint workflow integration with MDS that you may want to go ahead and read.  You can find it here - http://msdn.microsoft.com/en-us/library/ff459274.aspx.

Thanks,

Brian

March 18, 2010 12:13 PM
New Comments to this post are disabled
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement