Archive for October, 2007

 
Oct
31
Posted (Brandon Satrom) in Architecture, Composite Applications, WF on October-31-2007

 

For the past couple of weeks, I have been doing an in-depth look at various mobile communication technologies (SMS, EMS, MMS, etc.) for the purposes of incorporating these technologies into our existing strategies. While the scenarios vary, most of the use-cases driving us to SMS et al. revolve around information delivery in areas where Internet connectivity is problematic, yet cell phones abound. It sounds counter-intuitive maybe, but in many regions (like Africa for example), it’s far easier to put up a cell tower than it is to lay cable of any kind. Thus, mobile technology can be found in many places where land lines and Internet access cannot.

 

Being the agenda-pusher that I am, I can’t pass up an opportunity to integrate this technology study with work I have already done and am doing. Since my biggest interest right now is in the Composite Applications space, I wanted to use one of the demos in this study to prove out (to some degree) the composition argument I have been making both in this blog and internally. Thus, I created a demo scenario for this study that sends a 1-way, application-originated SMS Text Message through an SMS Gateway (Clickatell in this case) to a mobile subscriber when a particular field on a list in MOSS is changed. Now, this scenario isn’t rocket science, nor is it earth-shattering. What it is, however, is me taking my own medicine. If I’m going to preach the Composite Applications gospel, I’d better try it on for size myself. Here’s how I implemented the scenario:

 

I started by creating a stand-alone custom activity in Windows Workflow Foundation. The code, with some key details removed, is included below. Note: In order use this yourself, you’ll need access to an SMS Gateway (like Clickatell, which is used here) and access to their HTTP API, if they have one. Not the only way to send a text message, I know, but SS7 Gateways can provide guaranteed message delivery to the subscriber.

using System;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Text;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;

namespace MyCompany.Workflow.Messaging.Activities
{
    public class SendSMSActivity : Activity
    {
        public static DependencyProperty NumberProperty =
            DependencyProperty.Register(“Number”, typeof(System.String),
            typeof(SendSMSActivity));
        public static DependencyProperty MessageProperty =
            DependencyProperty.Register(“Message”, typeof(System.String),
            typeof(SendSMSActivity));

        [DesignerSerializationVisibilityAttribute
            (DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [DescriptionAttribute("Destination number of SMS message")]
        [CategoryAttribute("SendSMSActivity Number Property")]
        public string Number
        {
            get
            {
                return ((string)(base.GetValue(SendSMSActivity.NumberProperty)));
            }
            set
            {
                base.SetValue(SendSMSActivity.NumberProperty, value);
            }
        }

        [DesignerSerializationVisibilityAttribute
            (DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [DescriptionAttribute("Text of SMS message")]
        [CategoryAttribute("SendSMSActivity Message Property")]
        public string Message
        {
            get
            {
                return ((string)(base.GetValue(SendSMSActivity.MessageProperty)));
            }
            set
            {
                base.SetValue(SendSMSActivity.MessageProperty, value);
            }
        }

        protected override ActivityExecutionStatus
            Execute(ActivityExecutionContext context)
        {
            string response;

            try
            {
                // Send the SMS Message
                response = SendSMS(Number, Message);
            }
            catch (Exception e)
            {
                response = e.Message;
            }

            // Raise the PageFinished event back to the host
            messageSentEvent(null, new MessageSentEventArgs(response));

            // Notify the runtime that the activity has finished
            return ActivityExecutionStatus.Closed;
        }

        public delegate void MessageSentEventHandler(object sender,
            MessageSentEventArgs e);

        private event MessageSentEventHandler messageSentEvent;
        public event MessageSentEventHandler MessageSent
        {
            add
            {
                messageSentEvent += value;
            }
            remove
            {
                messageSentEvent -= value;
            }
        }

        public string SendSMS(string number, string text)
        {
            WebClient apiRequest = new WebClient();
            apiRequest.Credentials = CredentialCache.DefaultCredentials;

            //Add a user agent header in case the requested URI contains a query
            apiRequest.Headers.Add(“user-agent”,
            “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 2.0.50727;)”);

            //Add the SMS details to the apiRequest object
            apiRequest.QueryString.Add(“user”, “xxxxx”);
            apiRequest.QueryString.Add(“password”, “xxxxx”);
            apiRequest.QueryString.Add(“api_id”, “xxxxx”);
            apiRequest.QueryString.Add(“to”, number);
            apiRequest.QueryString.Add(“text”, text);

            string baseURI = “http://api.clickatell.com/http/sendmsg”;

            Stream responseStream = apiRequest.OpenRead(baseURI);
            StreamReader reader = new StreamReader(responseStream);
            string responseCode = reader.ReadToEnd();

            //Clean up in-memory objects
            reader.Close();
            responseStream.Close();

            return (responseCode);
        }
    }

    public class MessageSentEventArgs
    {
        private string response;
        public string Response
        {
            get { return response; }
        }

        public MessageSentEventArgs(string response)
        {
            this.response = response;
        }
    }
}

Like I said, nothing earth-shattering. However (and I won’t go into the details of WF here as there are plenty of good resources that do that) the end-result is a stand-alone Workflow Foundation Activity which encapsulates the business logic for distributing an SMS Text Message via our Gateway provider and which can be hosted in any application that provides the WF runtime. This Activity can easily be dropped into a container Sequential or State-Machine Workflow project (as I did when testing this activity on my machine), or it can be deployed to MOSS as a stand-alone activity which can be included in a Workflow built using SharePoint Designer. Two scenarios with different composers, both using the same asset. That’s the vision of Composite Applications. (As an aside, with the recent Oslo announcement, I imagine that we’re not far from a day where that same activity could be also be reused in BizTalk and Microsoft CRM, among others).

 

So what do those scenarios look like? For the developer adding a custom activity to a WF Workflow, it’s a simple matter of dragging the activity from the Toolbox to the designer, then binding to the DependencyProperties (Number and Message in this case) and creating an event-handler to receive the event raised by the activity (in this case, sendSMSActivity_MessageSent). See the image below for an example:

 

CustomWFActivityInVS

For an individual slinging SharePoint Designer, the experience is different, but also quite powerful. However, The first step I must take as an activity developer is to deploy said activity to the MOSS server. This requires deploying the Activity assembly to the GAC on the MOSS server, adding said assembly as a safe control in the web.config file, and adding the Activity to the WSS.actions file (or a new .actions file in the same directory, which is probably a better idea), which SharePoint designer uses to load up the list of available workflow actions. All of this can be done via a feature in SharePoint (I know that the first two can and I think that the last can, so feel free to comment if I am incorrect). Here is the code for the WSS.ACTIONS file (Added in the <Actions> section):

<Action Name=Send an SMS Text Message  ClassName=MyCompany.Workflow.Messaging.Activities.SendSMSActivity  Assembly=MyCompany.Workflow.Messaging.Activities, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=fe2315b70tbc147c  AppliesTo=all  Category=Messaging Actions>
  <RuleDesigner Sentence=Send %1 to number %2>
    <FieldBind Field=Message Text=this message DesignerType=TextBox Id=1/>
    <FieldBind Field=Number Text=this number DesignerType=TextBox Id=2/>
  </RuleDesigner>
  <Parameters>
    <Parameter Name=Number Type=System.String, mscorlib Direction=In />
    <Parameter Name=Message Type=System.String, mscorlib Direction=In />
  </Parameters>
</Action>

Once that entry has been added, the activity is ready to be included in an SP Designer workflow. In this example, I bound the workflow to a custom list created in a demo site, set a condition to check the value of a key field, then added the “Send SMS Message” activity and configured its inputs. In this case, the message is constructed from existing information in the list and the destination number is determined by looking up the mobile phone of a user in another list. An image of the Workflow Designer Wizard in SP Designer can be seen below:

 

WFActivityInSharePointDesigner

If the workflow validates, we’re in business and the activity will run each time a list item is added or updated and the field in question isn’t blank. Here is the Workflows application page, as seen from MOSS itself:

 

WFPageInMOSS

In addition, that activity is now available to include in any workflow where sending an SMS notification is a requirement. You be the judge if this is a blessing or a curse… In either case my hope is that this post illustrates the power of composition. And MOSS is just an example in this case, not the end-all for composition by any means. What important in any composition scenario is a platform and technologies that provide the ability to create reusable assets and then reuse those assets across tiers and containers.

 



 
Oct
29
Posted (Brandon Satrom) in Business, EA, Enterprise Architecture on October-29-2007

 

I’ve worked for organizations where IT moves too fast (and thus wastes money and alienates customers) and others where IT moves too slow (and thus the customers go around IT as much as possible). I’ve also worked in places where IT does both, often in the same day.

 

This week, I have the pleasure of sitting in all-day meetings related to a series of IT infrastructure projects we are pursuing. The folks in charge of coordinating this effort brought in a vendor to lead a brief engagement designed to help IT project teams and key business stakeholders better understand how to proceed with these key projects. This is a noble goal, and it’s one I support. However, I fear that the engagement was put together too quickly and with almost no deliberation. It’s just my opinion, of course, and I’m sure that this engagement will have some value. I, for one, want to make sure that we obtain that value even though the process has been a bit hasty. But will it have equal value to the dollar amount on the contract? That I don’t know.

 

To be fair, I’m certain that we’re moving quickly in this effort because we’ve been far too slow with similar efforts in the past. But, it seems as though the pendulum has swung the other direction. So here is the underlying question: How does IT get things done, without moving too fast or too slow? Here are a couple of my thoughts off the top of my head:

 

1) Empower people in the right places - IT doesn’t need to poke it’s nose into all areas of the business just because something smells like technology. The question is, what information technologies do we need to be involved in?

 

2) Respect the Business and Keep them Informed - IT managers like to talk about getting users in the room, then they go and demand they be present without respect for the ever-crushing workload which they have to deal with. If you need to move fast, and you need your customer, it’s your responsibility to move mountains for them, not ask that they do so for you. 

 

3) Remember who you are working for - An extension to number 2. Sometimes is looks like IT is the tail wagging the organizational dog, as if our business units exist to use our technologies. If IT feels the need to get things done fast, then I would imagine that there is a good business reason for doing so (there had better be). If that’s the case, its our responsibility to help the business understand how moving fast is our best bet for meeting that need. When we help the business understand that, they get in our corner and help us move as a partner, not someone we feel the need to drag along.

 

What else am I missing here? Quite a bit, I’m sure, so additional thoughts would be appreciated.

 



 
Oct
11
Posted (Brandon Satrom) in Architecture, EA, Enterprise Architecture, REST, SOA, User Experience, Web 2.0 on October-11-2007

Saw this post from Brady Forest on O’Reilly Radar, which points to the official announcement on the AWS blog. This may not mean as much to many of you who have been using S3 for a while now, but it’s big news for a guy like me because I know better than to bring technologies like S3, EC2 and Mechanical Turk into any serious internal conversation unless I can say “yes” to that SLA question. Looks like AWS is getting ready for prime time. And why not? Most of us have been expecting this for a while now.

 

I will echo Arthur’s request for more to the SLA, specifically for stats on uptime and availability. I think that all services should provide information like this to be as clear as possible in letting you know what you are getting by consuming said service (and our internal guidelines say as much), but this kind of information is especially vital with services in the cloud. I’m confident that they’ll get there, but in the meantime, I’ll echo that feature request.

 

On another note, why the heck is O’Reilly charging $149 for a glorified whitepaper on developing applications for Facebook? I use Facebook. I like Facebook. I think there is something to be said about developing applications for it… in certain situations. But could we just take a moment to breathe here before they hype train carries us all away?

 



 
Oct
06
Posted (Brandon Satrom) in Architecture, Business, EA, Enterprise Architecture, Green IT, SOA on October-6-2007

 

  • SOA: Sometimes it IS about the technology - Both Nick’s post and Andrew McAfee’s original are worth a read and right on. I think the pearl of wisdom is for all of us to stop advocating one extreme or the other (”x is about technology” vs “x is not”) all the time and start using wisdom, common sense and a willingness to either talk about technology (when the situation calls for it, as Nick describes when one must know which “… goals are realistically achievable given current technology trends”) or leave technology out of the discussion (when the situation calls for us to convey to the business that we truly get their business need and aren’t simply looking for a way to implement the cool new technology).
  • Why Microsoft Should Not Support SCA - Bottom line as I read this: Microsoft doesn’t benefit and neither does anyone else. It makes sense, but David certainly makes SCA seem like less of a “big deal” standard than others want us to believe. Not sure what I think yet, but  I would highly recommend David’s Introducing SCA article. It’s a good read and provides a good overview of some big technology movements outside of the Microsoft world.
  • Green Datacenter Initiative - The idea of “Green IT” is becoming a bigger and bigger deal as more organizations realize that Global Warming is not a joke (it never was) and that the measure corporate ethics and responsibility will increasingly include the impact of their IT organization on the environment. As Simon says, the measurement technology isn’t there yet, but why not start grassroots with your own PC. Downloaded the LocalCooling app Simon links to and get an idea of how little things we all do as individuals does have an impact.

 

Technorati Tags: , , , ,



 
Oct
04
Posted (Brandon Satrom) in Architecture, Information Architecture, Web 2.0 on October-4-2007

 

  • Releasing the Source Code for the .NET Framework Libraries - Kudos Microsoft. No question that this is a good move.
  • TED 2007 - The seemingly impossible is possible (Video) - Hans Roslings uses some of the best information visualization I have ever seen (Google must agree, because they bought his Gapminder tool) to deliver a great 20 minute presentation about how our cut and dry segmentation of the world into developed and developing countries is wrong and that we have the means and ability to eliminate poverty in our lifetimes. It’s well worth 20 minutes.
  • Is Twitter Useless, Asinine, or The Crocs of The Web? I love the comparison of Twitter to Crocs and think it’s true: There are those that find Twitter pointless (my wife) and those that can’t understand why people can’t see the simple elegance of power of it (myself). But more than the ability for me to know where my friends are going for dinner, Twitter is a paradigm for multi-channel information sharing and that can be quite powerful for organizations as well as individuals.

  • Learning from Bill Gates & Steve Jobs - Steve Jobs’ amazing presentation skills isn’t news to anyone, but I like this post largely because of the side-by-side depiction of a Bill Gates slide deck and a Steve Jobs slide deck. It makes a strong point…

 



 
Oct
03
Posted (Brandon Satrom) in Architecture, Content Mangement, ECM, Search on October-3-2007

 

  • Office Live Workspace revealed: a free 250MB “SharePoint Lite” for everyone - This isn’t the Google killer since it’s not an “online” version of the classic office applications. What it is is the slow-moving-and-customer-ignorant-IT-organization killer, which is a great thing as far as I’m concerned.
  • Sharepoint is not a good development platform / SharePoint is a good development platform for applications / SharePoint is an Awesome Dev App Platform - One of our SA’s said early on in his experience with MOSS 2007 application development that “MOSS takes the rapid out of Rapid Application Development,” which I think is true in the OOB development experience. Since then, however, we have been able to experiment with varying ways to develop apps in MOSS and have started to see areas where we can create value and assist in speed by abstracting out some of the complexity. That being said, Visual Studio needs to catch up and help make that development experience richer. As Andrew Connell said, that’s a knock on tooling and the development environment, not the platform itself.

  • MOSS Faceted Search (CodePlex) - If you’re using or plan to use MOSS and you want your users to get the most value out of Search, I would recommend taking a serious look at faceted search.

 

All MOSS Links today… some days are just like that I suppose. :)