Wednesday, April 6, 2016

Execute custom command with Deployment Framework (BTDF) in BizTalk

Some time back one requirement came to me to run some custom command execution using the Deployment Framework or BTDF.

Problem : any way, where in we can keep an orchestration in the unenlisted state using BTDF

Solution : above requirement can be fulfill with two approches

1) we can keep the property  State="Unenlisted" in PortBindingsMaster.xml file for orchestration which you wanted to keep unenlisted, but make sure StartApplication set to false.

2) using WMI script we can Unenlist the orchestration post the successful deployment using the BTDF

In Target we can create one custom Target which run post deployment in BTDF, following is the sample,

<target name="CustomTargetDeploy">
    <Exec Command="my_command_to_execute" />
</target>

instead of text "my_command_to_execute" we can write our own command like (rename, copy, del etc.) we can also call the batch file as well, following is the command line arguments for Unenlisting the orchestration.


 cscript.exe "c:\Program Files (x86)\Microsoft BizTalk Server 2010\SDK\Samples\Admin\WMI\Stop Orchestration\VBScript\StopOrch.vbs" "myNameSpaceName.OrchestrationName" "myAppName" Unenlist

we need to save above command as OrchUnenlist.bat then call this in Custom Targest.



Hope this Helps!!!

Tuesday, April 5, 2016

ItineraryState does not updating with 'Complete' status in BizTalk

I have got one of the requirement wherein i have to analyze the performance of Itinerary. like how much time overall an Itinerary can take.

Problem: Itinerary status does not updates with 'Complete' even though Itinerary flow is completed.

Solution : Whenever you face such issues first checkpoint that you need to look at is see if you have configured the right pipeline on your send port(static or dynamic) and make sure you have selected the Microsoft.Practices.ESB pipelines like ItinerarySend or ItinerarySendPassThrough or any of your custom pipeline having the Dispatcher component.




Hope this helps!!!
 

Monday, April 4, 2016

Word Casing check in BizTalk BRE

I got one reuirement where in I will have any case type of word as an input and i have to put if condition on that word in BizTalk BRE.


Problem : from input schema element value can be come in any casing format(Upper case, Lower case, Camel case)

input schema element should be checked using the BizTalk BRE if statment

Solution : Out of box BizTalk supports Match predicate which checks the elements with regular experssion matches with the left hand oprand.

Predicate : Match

Regular Expression : (?i)vikas\b


Input Schema :

<ns0:PO xmlns:ns0="http://POSchemas.PO">
<POName>vikas</POName>
<PONum>PO_12</PONum>
<POAmount>0</POAmount>
<PODate>2011-01-01</PODate>
<Items>
<ItemName>Screw</ItemName>
<ItemQty>5</ItemQty>
<UnitPrice>2.1</UnitPrice>
<ItemSum>1.2</ItemSum>
</Items>
</ns0:PO>


Test Result :

CONDITION EVALUATION TEST (MATCH) 4/4/2016 4:10:11 AM
Rule Engine Instance Identifier: 5d772604-6224-4e40-8455-656f09ab4807
Ruleset Name: LowerCaseCheck
Test Expression: True == Match(TypedXmlDocument:POSchemas.PO:/PO.POName, (?i)vikas\b)
Left Operand Value: True
Right Operand Value: True
Test Result: True

Hope this will Helps!!!!


Regards,

Sunday, January 4, 2015

How to enable and disable Audio/Video Recording with Microsoft OneNote

During past few days i was encountering the issues of Recording option is disabled and i was not able to records the meetings held client and other senior persons.

After some google analysis i found that some reasons my Recording functionality is stopped/disabled. then i tried to search the options to enable the Recording and i found only one way to achieve it throguh Registry

here is the path where you need to set the approprite option to enable/disable

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\OneNote\options\audio

Enable : set 0
Disable : set 1

make sure if you have multiple office versions installed you need to make same changes for all versions.

hope this will be helpful to you!!!!

Tuesday, April 15, 2014

Get Duplicate number of records for a column in one Table using Group By and Having clause

Those who are looking for some solution of how to get the number of duplicate records in a Table for particular rows. here is how we can achieve this requirement.

SELECT G_USER,COUNT(G_USER) FROM USER_PROFILE GROUP BY G_USER HAVING COUNT(G_USER) >1


 Using the Group By and Having clause of T-Sql we can achive this requirement stated in sample above, all you need to do is change the Table name and Column Name with your database objects names.

Hope would be Helpful!!
 

Saturday, November 9, 2013

Query to Check Currently running queries on Database server

If you are looking for which query executing on server you can use the following query to get the result


SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext


if you want to kill some long running query then you can fire following command to terminate the query execution

kill [process id]


Happy Coding.

Wednesday, October 30, 2013

Generate Random Alpha Numeric Number with

When we require to generate unique id without using NEWID() function of sql, here is the good alternative to generate unique alpha nemuric identifier to use at primary key.

DECLARE @alpha_numeric VARCHAR(16)
SET @alpha_numeric=''

SELECT @alpha_numeric=@alpha_numeric+CHAR(n) FROM
( SELECT TOP 16 number AS n FROM master..spt_values WHERE TYPE='p' and (number between 48 and 57 or number between 65 and 90) ORDER BY NEWID()) AS t

SELECT @alpha_numeric


Hope this will be helpful to generating manual alpha numeric identifier.

Happy Coding!!