Tuesday, July 18, 2006

BizTalk Concepts 2

Promoted properties and distinguished fields enable various BizTalk components to access key items of data contained in a message. Property promotion provides a way to access key pieces of information from within a message instance and to make that data more easily accessible to other components of BizTalk Server, such as orchestrations, Health and Activity Monitoring (HAT), and port filters. A promoted property is promoted to make it accessible outside the message (on the envelope) , whereas a distinguished property is simply an alias to easily refer to a schema node from within an orchestration. Messaging processes use promoted properties, while the orchestration engine uses distinguished fields

A promoted node can be used in Message Correlation, Message Tracking and in creating Message Subscriptions.

Correlation is the process of matching an incoming message to the appropriate instance of an orchestration. This is commonly used with long-running transactions in which the orchestration instance may be waiting for additional information to be received before it can continue with the business process.
A Gentle Introduction to Microsoft BizTalk Server 2004 Correlation
http://www.microsoft.com/belux/msdn/nl/community/columns/himschoot/correlation.mspx

BRE- Policies are logical groupings of rules.

Both BizTalk global properties and promoted properties from a BizTalk schema can be used for content-based routing.
To enable efficient interaction with a business partner, you use role links to group a set of ports through which you will communicate with the partner


Scope Shape with Transaction option set to none. If you want to implement error handling but do not want to use transactions, use a scope shape. You can still add exception handling to your orchestration without using a transaction.

Reference: Clinic 2954: First Look: Microsoft® BizTalk® Server 2006 for Developers

Tuesday, July 11, 2006

ASP.NET - A DropDownList cannot have multiple items selected

if you set in HTML, Selected="True" for DropDownlist and later try to set it programmatically, ‘ll get the error


A DropDownList cannot have multiple items selected.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: A DropDownList cannot have multiple items selected.

ASP.NET – controlling PostBack through JavaScript

this.TextBox1.Attributes.Add("onchange", "if (doSomeThing()) ");

Note the if & extra parenthesis around the client function.

When a webcontrol with AutoPostBack=True is rendered, the ASP.NET insert a javascript function as __doPostBack(,) in the page and bind this function to client events corresponds to the server side bound events.

e.g. the HTML on the client side looks like:

<input name="TextBox2" type="text">onchange="__doPostBack('TextBox2','')" />

By adding the if (doSomeThing()) , it becomes

<input name="TextBox2" type="text">onchange="if (doSomeThing()) __doPostBack('TextBox2','')" />

The doSomeThing() function must evaluate to bool.

Monday, July 10, 2006

BizTalk Concepts 1

Profiles, agreements, and addendums are all stored in the TPM database. Using the TPM component (and for addendums, the Business Process Configuration component, described next), all of them can be configured directly by an information worker. This allows business people to establish and modify new partner relationships without relying on developers.

graphically-defined processes called orchestrations

Business Rules Engine that allows evaluating complex sets of rules

Health and Activity Tracking tool that lets developers and administrators monitor and manage the engine and the orchestrations it runs.

Enterprise Single Sign-on facility, providing the ability to map authentication information between Windows and non-Windows systems

  • Business Activity Monitoring, allowing information workers to monitor a running business process. The information is displayed in business rather than technical terms, and what gets displayed can be controlled directly by business people.
  • Business Activity Services, allowing information workers to set up and manage interactions with trading partners.

two scenarios are most important for application integration. One is connecting applications within a single organization, commonly referred to as enterprise application integration (EAI). The other, called business-to-business (B2B) integration, connects applications in different organizations.

Integrating existing applications, whether in a single company or across different organizations, into a single automated business process is a fundamental goal of BizTalk Server 2006

Orchestrations can optionally use the Business Rules Engine, which provides a simpler and more easily modified way to express complex sets of rules in a business process.

A BizTalk application wraps all of the pieces required for a solution into a single logical unit, making it the fundamental abstraction for management and deployment.

An adapter is an implementation of a communication mechanism, such as a particular protocol.

  • Decode: BizTalk Server 2006 provides one standard component for this stage, the MIME/SMIME Decoder. This component can handle messages and any attachments they contain in either MIME or Secure MIME (S/MIME) format. The component converts both kinds of messages into XML, and it can also decrypt S/MIME messages and verify their digital signatures.

When a message is processed by a receive pipeline, a message context is created that contains various properties of the message

it’s also possible to subscribe to specific error conditions

. To define the logic of a business process, the BizTalk Server 2006 engine provides orchestrations. To create and evaluate groups of business rules, it provides the Business Rules Engine.

creating an orchestration relies on three primary tools: the BizTalk Editor for creating XML schemas, the BizTalk Mapper for defining translations between those schemas, and the Orchestration Designer for specifying the logic of business processes.

BizTalk Mapper can be used to define a transformation, called a map, from one document to the other

. A functoid is a chunk of executable code that can define arbitrarily complex mappings between XML schemas

The Scope shape, which allows grouping operations into transactions and defining exception handlers for error handling. Both traditional atomic transactions and long-running transactions are supported. Unlike atomic transactions, long-running transactions rely on compensating logic rather than rollback to handle unexpected events.

Once a developer has defined an orchestration, the group of shapes and relations between them is converted into the Microsoft Intermediate Language (MSIL) used by the .NET Framework’s Common Language Runtime (CLR). Ultimately, the group of shapes defined by a BizTalk Server 2006 developer becomes just a standard .NET assembly.

the Business Process Execution Language (BPEL

for more business-oriented users to create and modify sets of business rules using a tool called the Business Rule Composer

The creator of a set of business rules will typically begin by using the Business Rule Composer to define a vocabulary for use in specifying those rules. Each term in the vocabulary provides a user-friendly name for some information

. The BRE can also be invoked programmatically via a .NET-based object model, which allows it to be called from applications that don’t use the BizTalk Server 2006 engine

to scale up as needed for high-volume processes

Monitor BizTalk applications. Using the BizTalk Administration console’s Group Hub page

Enterprise Single Sign-On stores an encrypted mapping between a user’s Windows user ID and his credentials for one or more affiliate applications in a credential database

This operation, called redemption, causes SSO server B to verify the SSO ticket, and then look up this user’s credentials for that application

Via a BAM portal, a new component in BizTalk Server 2006 that allows examining and configuring BAM information

, the BAM portal can also be hosted as a Web part inside Windows SharePoint Services

  • Using the BAM portal’s alert manager, an information worker can define alerts that should be sent when an interesting event occurs. For example, a BAM user might choose to send an email to a particular manager whenever the number of cancelled orders in a day exceeds ten, or perhaps inform a certain sales associate any time an order arrives from her largest customer.

each BAM view relies on one or more BAM activities. A BAM activity represents a specific business process, such as handling purchase orders or shipping a product, and each one has a defined set of milestones and business data.

. This add-in’s BAM Activity wizard allows defining activities, while its BAM View wizard allows defining views based on those activities

Using a tool called the Tracking Profile Editor (TPE), a developer must configure an orchestration so that it provides the information required for a particular BAM activity, and thus for the BAM views that depend on this activity.

The BizTalk Server 2006 engine then sends these events and message field values to the Tracking database

where they can be accessed by the BAM component

Any application built using the .NET Framework or WinFX, a set of new development technologies that will appear with Windows Vista, can potentially be monitored using the BAM component of BizTalk Server 2006.

Trading Partner Management (TPM) component. This component relies on a TPM database, as shown above, that stores information about trading relationships. Using the common Business Activity Services interface, information workers can create and modify agreements with trading partners who use BizTalk Server 2006. Each agreement describes the relationship between two parties,

A messaging component that provides the ability to communicate with a range of other software.

Reference:

Understanding BizTalk Server 2006, Microsoft Corp

Friday, June 30, 2006

Auto Save Web Form Data

see my article about saving webform data in ASP.NET on code project

http://www.codeproject.com/useritems/AutoSaveFormData.asp

Wednesday, May 03, 2006

A quote

When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me."  Erno Philips

Thursday, April 13, 2006

ASP.NET Debug true

“When debug is set to true, asp.net requests will not time out. This is to allow you to debug with visual studio at your own pace without having to worry about the requests suddenly disappearing. Of course in a production environment timeouts are crucial to avoid for requests to be stuck indefinitely, so this is reason #1 to make sure debug is set to false when the application is deployed into production.”

From http://blogs.msdn.com/tess

Monday, February 13, 2006

Writing Code...

“Writing specifications is like writing a novel. Writing code is like writing poetry"

Tuesday, January 24, 2006

Delegates and Events in C# (1.1)

Delegates and Events in C# (1.1)

An excellent article

http://www.akadia.com/services/dotnet_delegates_and_events.html


Debugging ASP.NET Applications with VS 2003


Debugging ASP.NET Applications with VS 2003


after hours of troubleshooting, I found this

If you created the Web project with a full machine name (like machinename.domainname.something), the Web site is recognized as Internet site. So, the default setting of Internet Explorer will impact on the behavior of logging on. In this case, you need to enable logging on with your current user account in "Internet" area with the IE setting.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vsdebug.asp

Thursday, January 19, 2006

Getting Caller method info

Getting Caller method name from method

StackTrace st = new StackTrace();
string str = st.GetFrame(1).GetMethod().Name;

Monday, January 16, 2006

Regular Expression

Regular Expression to select HTML elements from the text

<select.*?</select>

.*? is for lazy (non-greedy) capture of the pattern.

Friday, January 06, 2006

SPS 2003 installation Issue

SPS 2003 installation: Installation ended prematurely because of an error

When re-installing SPS 2003 on a Windows 2003 Server, I got the error "Installation ended prematurely because of an error".
To resolve this issue, I’ve to remove the Windows SharePoint Services 2.0 and then run the setup of SharePoint portal server 2003 again.  This will make the installation of SharePoint Portal Server 2003

Thursday, January 05, 2006

Notes on C# 2.0 (Nullable Types)

C# 2.0 ( Nullable Types)

Nullable types are constructed using the ? type modifier. This token is placed immediately after the value type being defined as nullable. The type specified before the ? modifier in a nullable type is called the underlying type of the nullable type. Any value type can be an underlying type.

int? i;
Point? nullPoint = null;
i = null;
nullPoint = new Point?(point);
public struct Real
  {
    int internalVal;
    public Real(int realNumber)
    {
        internalVal = realNumber ;
    }
}
Real? real = new Real?(new Real(3));
The null coalescing operator takes as arguments a nullable type to the left and the given nullable type’s underlying type on the right. If the instance is null, the value on the right is returned otherwise the nullable instance value is returned.
int? i;
i = 10;
int j = 20;
string str = Convert.ToString(i ?? j);
MessageBox.Show(str);
The statement (i ?? j) returns i if i is not null, otherwise it returns j.

The new ?? binary operator allows you to conditionally test for null and use an alternative value instead. For example, consider the following assignment.
int myvalue = (x != null ? x : 0);
With the ?? operator, this can be rewritten as:
int myvalue = x ?? 0;
This indicates to assign the value of x to the myvalue variable or 0 in the case that x is null.

Tuesday, December 27, 2005

Freedom

Freedom comes in small packages........
usually TCP/IP.

Tuesday, December 20, 2005

quotes from Debugging the Development Process

quotes from ‘Debugging the Development Process’ , Steve Maguiret)

  • Don’t waste the developers’ time on work that does not improve the product.

  • Always determine what you’re trying to accomplish, and then find the most efficient and pleasurable way to do it.

  • Establish detailed project goals to prevent wasting time on inappropriate tasks.

  • Don’t Fix Bugs Later, Fix them now.

  • Regularly Stop what you’re doing and look ahead, make little adjustments now to avoid big obstacles later on.

  • Each day, ask, “What can I do today to help keep the project on track for the next few months?”

  • Don’t waste time working on the wrong problem. Always determine what the real problem is before you try to make a fix.

  • People often ask for something other than what they really need. Always determine what they are trying to accomplish before dealing with any request.

  • Never commit the dates you know you can’t meet. You’ll hurt everybody involved.

  • Beware of recurrent meetings. Make sure they’re worth the disruption they cause.

  • Before calling any meeting, be sure you know exactly what you want to achieve and what you need to achieve it. Then make sure you do achieve it.

  • Make sure each team member learns one new significant skill at least every two months.

  • Watch out for and correct the “It’s too much work” reaction. Train programmers to first consider whether task makes sense and whether it matches up with the project goals and priorities.

  • Don’t ship substandard feature. Postpone them until you can implement them properly.

  • Give some priority to writing easily shared code. Programmers can’t share each other’s code unless they’re writing it so that it can be shared.

  • If your project is slipping, something is wrong. Don’t ignore the cause and demand long hours of the team members. Find and fix the problems.

  • Beware of the misguided belief that long hours result in greater productivity. If anything, long hours only hurt productivity.

  • Stress the importance of thinking hard, not working hard.

  • Train the development team to work efficiently during a normal workday. Don’t allow them to work long hours, which servers only to mask time-wasting activity.

Tuesday, November 22, 2005

event handler: Cannot complete this action


I made an event handler for doclibs to log the document updating and deletion activities. After deployment, the event handler for document library was logging the delete event but giving the exception on update event: “Cannot Complete this action, Please try again.”
After much effort, I found that the problem was with WSS Service Pack 2, and the exception was raised when try to access SPListItem collection.
The issue was because of increased security with WSS sp2.
http://support.microsoft.com/default.aspx?scid=kb;en-us;909455

The resolution is
using System.Security.Principal ...
WindowsImpersonationContext wic = WindowsIdentity.GetCurrent().Impersonate();
//implement OM code here
wic.Undo();

Thursday, November 17, 2005

Attach an Event sink with Multiple Document Libraries

Attach an Event sink with Multiple Document Libraries
There is no easy way in SPS 2003 to attach an event sink with multiple document libraries. You have to iterate each one manually or programmatically, following is the hack for this (SPS 2003)
For existing doclibs
Db: _Site
update lists set
     tp_EventSinkAssembly = 'WSSEventSink, Version=1.0.0.0, Culture=neutral,                                          PublicKeyToken=56761703e95c64a0',
     tp_EventSinkClass ='WSSEventSink.EventSink'
where tp_ServerTemplate = 101 --doclib

For newly created doclibs
Schema.XML
<List  EventSinkAssembly="WSSEventSink, Version=1.0.0.0, Culture=neutral, PublicKeyToken=56761703e95c64a0" EventSinkClass="WSSEventSink.EventSink"