Thursday, March 26, 2009

A Better Rules Engine for BizTalk

Last night I (along with my colleague Dave Birchall) had the privilege of presenting at Microsoft Australia to the BizTalk Users Group (thanks Mick Badran!).








Our topic centred around the InRule business rules engine and business rules management system - and how it might work with Microsoft BizTalk Server. As many of you in the world of BizTalk might know from experience, the BRE supplied can be quite limiting and inefficient to work with.

So how do you go about using InRule to supplant the BRE?

Quite simply really. You have 2 main options to call InRule from the BRE:

  1. Utilise the supplied irAdapter that comes with the InRule irServer installation

  2. Call a static .NET method from an Expression Shape in a BizTalk orchestration - which in turn calls upon the InRule runtime libraries to apply rules to the data you pass.

InRule can supply much greater flexibility and capabilities beyond what the BRE was designed or intended for. You may find the BRE is suitable for your needs, but as soon as you go beyond simple IF ... THEN statements, you might want to have a look at a 30 day trial of InRule to see if it is appropriate.

In the coming weeks I will also put together a video on InRule with BizTalk including a demonstration on how to phyiscally connect BizTalk to InRule. So stay tuned!

FYI: If you missed last nights demonstration I can arrange for you to view a copy online. Just drop me a comment below and I will get in contact with you.

Monday, March 23, 2009

Outlook Web Access (OWA) Not Sending Emails

Recently I found myself out of the office with web mail access only. As we have Exchange 2007 I was able to connect to our web mail via Outlook Web Access (OWA). I found that I would compose a new email (or reply) and hit 'send', but the new message would only be persisted and get stuck in the Drafts folder.

This seemed to only happen on occasional days, and it didn't matter if I was using the OWA Light Version or Full Version. Nor did it matter that I was using it from my mobile or laptop or home computer.

After some hunting I found the solution:

Don't leave Outlook running under your session/user account on any other computer! Close all other sessions you may have open!

It appears that if you have an active Outlook session from say a desktop, or remote desktop (TS) connection - your web mail from OWA will not send. This was a hair pulling event for me - hopefully it helps you with a possible frustrating set of patches, updates, security changes in your browser etc. etc.

Friday, July 25, 2008

BRM & BRE: Let the Business Manage the Rules

Total cost of ownership (TCO) plays a large part in the consideration of developing, purchasing and building of enterprise software applications. Not only does one need to consider how much effort and cost it will take to gather requirements, analyse, design and implement the system, but also what will the ongoing costs be.

One of the key factors to understanding in the costs of supporting and maintaining a system is how often the underlying requirements are expected to change. This would include the data structure (adding and/or removing required fields), process and work flow adjustments, user interface updates and changes to business rules.

When changes to arise, they are generally driven by the 'business'. This would normally mean that a business analyst(s) would work with the project sponsors and define and document the new requirements at great length and in great detail.

Then (historically) all of the above items would need to be reviewed, understood, managed and re-worked by the software developers in a build and test cycle. Once the unit tests were complete, full regression testing across the entire system would ensue, then the business would be required to test everything again during the user acceptance testing (UAT) phase. This of course would include other members of the tech team including Project Managers and Testers.

The things that usually change most often, and are the most expensive to update, are the business rules. A business rule can be anything from a simple statement such as:

IF AnnualSalary IS GREATER THAN $100,000 THEN Approved=True

... to a much more complex set of variables and logic that would result in a series of actions:

IF AnnualSalary x RiskScore IS LESS THAN 45 THEN EXECUTE
   Approved = Tentative
   Action = Forward to Telephone Representative
   Action = Print Tentative Acceptance Letter
   Action = Notify Manager of Possible Override
   END

Of course real-world examples would likely be even more complex (imagine the business rules associated with emergency services dispatch).

New tools have been created to give business users the ability to manage, test and implement business rules without the use of the software development team.

A Business Rules Engine (BRE) is the part of the system that allows for execution of the business rules against the data of your system. A Business Rules Manager (BRM) is the set of tools that allows you to create and update rules which are then stored in some sort of repository to be consumed by the BRE.

What this means is that the business analyst can be trained up to use a BRM to create, update and test business rules, and deploy them enterprise wide completely independently. Any business process oriented organisation (which is pretty much all of them!) can take advantage of moving the rules from the developers to the business analysts and save a great deal of time and money and reduce risk.

There are quite a few BRE/BRM systems out there. MS Biztalk ships with a BRE, however it is not nearly as flexible as some of the others (you can only do IF...THEN, which is VERY limited).

My favourite is from a group in Chicago called InRule (www.InRule.com). Very slick interface, great interoperability with Microsoft .NET (it was written in .NET) and very good linkage to Biztalk. They are also a great crew of people to interact with - excellent customer service. Other contenders include Drools, JRule, iLog, Visual Rules, Hayley, NXBRE and QuickRule.

Anyhow I could write dozens of pages about this topic but that would be a bit overwhelming for the readership. If you want to know more let me know via comment and I will set up a conversation with you.

.

Friday, July 18, 2008

HOWTO: MS CRM 4.0 Show Phone Number on Phone Call Form

I have recently started working with Microsoft CRM 4.0 and have been smitten a bit by its capabilities. However I do find that out of the box there are some simple things missing that would have been nice to provide.

One of the main items is this: if you open a new Phone Call form and select the Recipient, you need to manually enter the phone number into the Phone Number textbox.

After lots of hair pulling I have put together the solution. Much of the 'customization' done effectively for CRM can be accomplished by reading from CRM web services. Below is a sample set of code in Javascript that I put behind the OnChange event of the Recipient field on the Phone Call form, to get this to work.

(Note: it displays only the first telephone number on record - I will add more functionality later that will allow the selection from a list of numbers allocated against the contact
. Also you may need to replace the &lt and &gt with <> respectively as this is html encoded.).


var lookupItem = new Array;

// Get the lookup for the primarycontactid attribute on the account form.
lookupItem = crmForm.all.to.DataValue;


if (lookupItem && lookupItem[0]!=null) {

var contactGUID = lookupItem[0].id;

//Prepare variables for a contact to retrieve.
var contactid = contactGUID;
var authenticationHeader = GenerateAuthenticationHeader();


//Prepare the SOAP message.
var xml = "&lt?xml version='1.0' encoding='utf-8'?&gt"+
"&ltsoap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"+
" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'&gt"+
authenticationHeader+
"&ltsoap:Body&gt"+
"&ltRetrieve xmlns='http://schemas.microsoft.com/crm/2007/WebServices'&gt"+
"&ltentityName&gtcontact&lt/entityName&gt"+
"&ltid&gt"+contactid+"&lt/id&gt"+
"&ltcolumnSet xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:ColumnSet'&gt"+
"&ltq1:Attributes&gt"+
"&ltq1:Attribute&gtfullname&lt/q1:Attribute&gt"+
"&ltq1:Attribute&gttelephone1&lt/q1:Attribute&gt"+
"&ltq1:Attribute&gtparentcustomerid&lt/q1:Attribute&gt"+
"&lt/q1:Attributes&gt"+
"&lt/columnSet&gt"+
"&lt/Retrieve&gt"+
"&lt/soap:Body&gt"+
"&lt/soap:Envelope&gt";

//Prepare the xmlHttpObject and send the request.
var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xHReq.setRequestHeader("Content-Length", xml.length);

xHReq.send(xml);

//Capture the result.
var resultXml = xHReq.responseXML;

//Check for errors.
var errorCount = resultXml.selectNodes('//error').length;
if (errorCount != 0)
{
var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
alert(msg);
}
//Display the retrieved value.
else
{
crmForm.all.phonenumber.value = resultXml.selectSingleNode("//q1:telephone1").nodeTypedValue;
crmForm.all.subject.focus();
}

}


Seems to work like a charm, now I don't need to open multiple windows to do my job.

Thursday, June 26, 2008

Tesla Motors - High Performance Electric Sports Car

Recently I came across what I would consider a huge leap forward for the planet - proof that our addiction to petroleum-based fuels has a rehab program: the resurgence of the electric car. Now this is not anything new by any stretch - electric vehicles have been around for quite some time now. However, a very smart, very well funded startup has emerged from Silicon Valley that will change the way we look at small, low performance, short ranged electric vehicles of days past.

Tesla Motors have invented and developed The Tesla. This battery-powered sex-on-wheels not only looks fantastic, it apparently outperforms similar petrol-powered counterparts. And if you charge this thing using solar power - your running fuel costs are exactly ZERO!



Here are some quick specs:
  • 0-100 km/h (60 mph) in 3.9 seconds!!
  • 350 km (220 miles) per charge (4-8 hours depending on 110 or 240v source - standard in homes)
  • Instant torque - 13 000 RPM red line
  • Approx 1 cent per kilometre operating cost (unless you use solar)
  • No toxic outputs (batteries can be recycled), no oil to change, 1 moving part in the engine
  • Circa $109k purchase price (USD - available only in US at the moment)
THIS is the future of short haul travel in style. There are plans to get 999 of these beauties out into the marketplace then begin the development of an SUV-style vehicle for more family oriented consumers.

The only downside I can see at the moment is that you can't have this serviced at any old garage: only Tesla certified engineers can work on it without voiding any sort of warranty. Plus, being only currently available in the US sadly means I won't be getting one any time soon. Hopefully the auto industry will see this as a wake up call and get the fully electric cars out of the production line by 2010.

Opinion:
------------
Uniqueness: 5/5
Interest Factor: 5/5
Stability: 5/5
User Experience: 4/5
Longevity: 5/5

Monday, June 23, 2008

QIK ... Stream Live to the Web via Your Mobile

This was bound to happen sooner or later, and I am actually very interested to see where this service goes. qik.com is a streaming video live-to-web service that uses the video camera on your mobile phone (limited to certain, but many models) via your mobile internet connection.

qik is yet another service in the plethora of those available in the ever-growing social media/web 2.0 space. It is based around a community of users that choose to follow or be followed (similar to Twitter in my previous post) but instead of text or pre-cut video, live video(or once-live but now captured) is the medium. You of course set up a user profile and if people find you or your videos interesting, they will 'follow' you and receive updates via the web, mobile, im and other social sites. qik will even push your video directly to YouTube, can link to your video in your Twitter update feeds, or even post updates here to Blogger.com. This is all achieved via a small bit of software you download to your mobile by sending an SMS (very straightforward.

Sounds a bit scary, since you cannot edit before airtime, but the applications to this are seemingly endless. Plus, if you live in Australia under antiquated mobile data charge schemes (its painful and expensive), your video updates can cost you a fortune. If you are stuck in a scheme like this, best to reserve your video push via a WiFi connection. (update: Optus is changing their mobile data plans to be linked to wireless broadband - $29 for 1 gig per month!)

I am willing to bet everyone's first video looks pretty much the same (a shot of the first test to prove that it works, usually involving a few seconds of looking at a keyboard, then the screen showing your video, then some random chatter)... yawn .... But once you dig through these you can find some fairly interesting content, if not mildly entertaining. Its surprisingly fast, efficient and very easy to use, so the barriers to entry are quite low.

There is a big community push by early adopters at the moment, which always puts an idea/company/infrastructure thorough its paces. So far things are remaining stable and robust which really does continue to impress me, even though the idea is fairly simple. I am willing to bet that qik will be around for some time and probably bought out by a big player like YouTube before too long.

Anyhow I recommend giving it a try, for no other reason that the novelty factor and showing off your keyboard to the world. What you do with it beyond that ... well, it certainly does add a dimension to vlogging, live news reports, showing your new dog tricks online or keeping your overseas family up to date.

Opinion:
------------
Uniqueness: 3/5
Interest Factor: 4/5
Stability: 4/5
User Experience: 4/5
Longevity: 3/5