Saturday, April 30, 2011

Difference between call by out and call by reference

out = ref -  (intiliazation)

void main()
{

int x,y,o,r;

//ref
r=0;
MultiMath(x,y,ref r);
MultiMath(x,y,out o);

}



functions

OUT
private int MultiMath(int a, int b, out o)
{
    o = a*b;
return a+b;
}

REF
private int MultiMath(int a, int b, out r)
{
    r = a*b;
return a+b;
}

http://www.c-sharpcorner.com/UploadFile/5eae74/6867/

Friday, April 29, 2011

WCF Workflow Service Application Enpoint configuration

 IService is a WCF Workflow Service Application Servicecontarct



<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
    <system.serviceModel>
        <services>
   <service name="xxxxxxx">
       <host>
           <baseAddresses>
               <add baseAddress="http://xxxxxx:1231/Configuration/"/>
           </baseAddresses>
       </host>
    <endpoint address="BDSIBUP301.xamlx"
     binding="wsHttpContextBinding" contract="IService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
   </service>
  </services>
        <behaviors>
            <serviceBehaviors>
                <behavior>
                    <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                    <serviceMetadata httpGetEnabled="true"/>
                    <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
</configuration>

Saturday, March 12, 2011

Introduction to Biztalk Business Rule Engine Facts

What is fact ?

Facts are discrete pieces of information about the world.  Facts can originate from many sources



Facts are discrete pieces of information about the world. Facts can originate from many sources (event systems, objects in business applications, database tables, and so on), and must be fed into the Business Rule engine in BizTalk Server by using one of the following elements:

Fact types.
  • .NET objects (methods, properties, and fields)

  • XML documents (elements, attributes, and document subsections)

  • Database rowsets (values from table column)

In the Business Rule Composer, you can use the Facts Explorer to browse and bring data into your rules from various sources.

.Net objects
In the Business Rule Composer, you can specify a .NET assembly as a data source

 Engine control functions

  This Engine control functions are allow the application or policy to control the facts in the rule engine's working memory.

Engine controlf functions are

Assert

Retract

RetractByType

Reassert

Update

Halt


Assert
Assertion is  the process  of adding object isntances into Business Rule engine's working memory.


The following table summarizes the assert behavior for the various types, showing the number of resulting instances created in the engine for each asserted entity, as well as the type that is applied to each of those instances to identify them.
Entity Number of instances asserted Instance type
.NET object1 (the object itself)Fully Qualified .NET Class
TypedXmlDocument1-N TypedXmlDocument(s): Based on Selector bindings created and document contentDocumentType.Selector
TypedDataTable1-N TypedDataRow(s):
One for each DataRow in the DataTable
DataSetName.DataTableName
TypedDataRow1 (the TypedDataRow asserted)DataSetName.DataTableName
DataConnection1-N (one for each TypedDataRow returned by querying the DataConnection)DataSetName.DataTableName




Retract:
You can use the Retract funciton to remove objects form the Business rule engine's working copy.

RetractByType
The RetractByType funciton retracts all instances of a specified type in the working memory, where as the Retract function retracts only specific items of a certain type.


Reassert

To reassert means to call the Assert function on an object that is already in the engine's working memory.

Update
When Update function is invoked an object, the object is reasserted into the engine to be re-evaluated, based on the new data and state.

 Halt
You can use the Halt function to halt the current rule engine execution. The Halt function takes one parameter of type Boolean. If you specify the value for the parameter as true, the rule engine also clears the agenda that contains the pending candidate rules.


http://en.wikipedia.org/wiki/Rete_algorithm


Friday, February 11, 2011

Basic Activity Designer WWF4.0

ActivityDesigner
(System.Workflow.ComponentModel.Design)

Activitydesigner is a class it provides a simple designer which lets the user visually design activities in the design mode.

ActivityDesigner provides a simple mechanism for the activities so they can participate in rendering the workflow on the design surface.


Activitydesginer class provides following designer features.


Rendering support by drawing icons, description, border, interior, and background.
  • Rendering help text.
  • Default glyphs required by designers.
  • Filtering design-time-specific properties.
  • Default event generation.
  • Default hit testing.
  • Triggering validation.
  • Tool-tip support.
  • Participation in keyboard navigation.
  • Accessibility support.
  • Toolbox support.
  • Theme support.
  • Smart tag support.
  • Message filtering support.
  • Event handling for mouse events.


Activity designers that support creating activities that have children—composite activities—must inherit from the CompositeActivityDesigner class in the System.Workflow.ComponentModel.Design namespace.

The CompositeActivityDesigner class provides the following designer features:

Expanding and collapsing the designers.
Drag-and-drop indicators.
Layout of self and child activities.
Drawing self and child activities.
Hit testing the child activities.
Inserting and removing activities from a hierarchy.

Following are different types of activitydesginers

reference from msdn