Message Aggregation in Orchestration

Hi,

I have a requirement like every 4 hours I have trigger a orchestration and then orchestration should start and pick all the files from another folder and process and aggregate & produce one file. So i have put the workflow like below. It is working fine.. first i put the scheduler file , then the orchestration starts and process each file in another folder and able to do it.. I am using Correlation set as "ReceivePortName".

Configuration

First recive shape (active with initialize correlation)

second receive shape (following correlation)

but I am facing one issue here like, if the data files comes before the scheduler file, that time also the orchestration triggers. and getting failed.. not sure why the second receive shape fires without initialze the orchestration.

Can you please help me the way to resolve this.. I tried a lot .. but getting the root cause of this

Aggregation

Thanks,

Vinoth

February 10th, 2015 4:02pm

It's because the second Receive Shape is not an Activating Receive Shape.

The above pattern requires the scheduler message always be first, it can't handle a data message being first.

To accommodate receiving either a scheduler message or a data message first, you will have to use a Parallel Convoy.  The combination with the Sequential Convoy can get tricky.

Let me suggest you address this another way.  BizTalk is not a scheduling engine so you may want to look at either the SQL Agent or Windows Scheduler to implement the 4 hour cycle.

In this case, if you are receiving files, you can use a Windows Scheduler task to copy the files form a staging folder to a Receive Location folder every 4 hours.  Then the orchestration is just a simple Sequential Convoy.

Free Windows Admin Tool Kit Click here and download it now
February 10th, 2015 5:18pm

Hi ,

So it means are we can't trigger the orchestration based on schedule and pick all the files from another folder and aggregate?. if so, can we use like below .. since i need the scheduler file as it has some information to process the data..

Instead of using like below,

"In this case, if you are receiving files, you can use a Windows Scheduler task to copy the files form a staging folder to a Receive Location folder every 4 hours"

After scheduler trigger the orchestration, call one method to move the files files form a staging folder to a Main Receive Location folder and the pick the files and aggregate ??. since we are using external assemblies for doing some logic. please correct me if i am wrong.

@Rachi: I am using same receive port using two receive location. i tried with two different receive port, but getting error like "You must specify at least one already-initialized correlation set for a non-activation receive that is on a non-selfcorrelating port" 

Thanks,

Vinoth
February 10th, 2015 5:34pm

So it means are we can't trigger the orchestration based on schedule and pick all the files from another folder and aggregate?

No, I did not say that.  I'm pointing out that the Orchestration above cannot handle out-of-order messages.  It can with a Parallel Convoy.

So, it seems the Scheduler Message is not just a 'scheduler', if it had data, it's more like a 'header'.

Are the files specifically related to each other or is it really just a scheduled operation, mean any files within the 4 hours windows get grouped?

Next question, do you really need the information in the 'scheduler message' to be from a file?

Free Windows Admin Tool Kit Click here and download it now
February 10th, 2015 5:43pm

Hi,

do you really need the information in the 'scheduler message' to be from a file?

Yes. The scheduler file has some information about date, and some header field information which is came from other job.

Yes. all the files are related. It means like each file has one complete Order/Invoice information and the file format is Flat file. Receive all flat files and put Header and trailer and use Line number for each line while aggregating to single flat file which contain all the information.

if we use Parallel convey , it will fetch the data files whenever file available in the folder and wait for scheduler file and do the process. it means all data is in memory till both info received. so if any exception or BT restart it will affect right ?

Thanks,

Vinoth




February 10th, 2015 6:14pm

If you use the correct Convoy patterns and the files are properly correlated, through some shared ID, then you don't need to schedule anything.  In fact, trying to schedule it, except maybe for delivery, just makes things harder.

The Orchestration might look like one big Parallel Shape with the the 'schedule message' on one side and the Sequential Convoy on the other.  Then they're merged at the end.

Free Windows Admin Tool Kit Click here and download it now
February 10th, 2015 6:38pm

Hi Vinoth,

There is 2 types of Sequential Convoye patterns available.

Non Uniform Sequential Convoy and Second Uniform Sequential convoy.

Non Uniform Sequential Convoy-->

When message types are different-for the Intailier and follower messages

UniformSequential Convoy--->

When Message types are same  for the follower and initializer

Please check this may help you.

February 11th, 2015 1:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics