Custom Pipelines
  • 22 Aug 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Custom Pipelines

  • Dark
    Light
  • PDF

Article summary

It is common that you might have your own custom pipeline components or want to create your own custom pipeline components using the Atomic Scope activity tracking API. In such scenarios, you need to refer two Atomic Scope assemblies as shown below. These DLL's will be present in the folder location \AtomicScope\Binaries on the machine where Atomic Scope BizTalk runtime components are installed.

image.png

In Pipeline component you need to create an instance of an activity request.

ActivityRequest activityRequest = new ActivityRequest()
{
    StageName = StageName,
    ProcessName = BusinessProcess,
    TransactionName = BusinessTransaction
};

Once the activity request is created, you can call methods for starting, updating activities as below.

PipelineActivity pipelineActivity = new PipelineActivity(inMsg, pContext);  
if (StartActivity)
  {
      stageActivityId = pipelineActivity.StartActivity(activityRequest);
  }

  if (UpdateActivity && !string.IsNullOrEmpty(stageActivityId))
  {
      pipelineActivity.UpdateActivity(activityRequest);
  }

You can archive the message by using Archive method.

if (ArchiveMessage && !string.IsNullOrEmpty(stageActivityId))
 {
      pipelineActivity.Archive();
 }

Any exceptions in the pipeline component can be logged using LogException method.

catch (Exception ex)
{
 if(inMsg.Context.Read("StageActivityId", "https://AtomicScope.Schemas") !=null)
 pipelineActivity.StageActivityId = Guid.Parse(inMsg.Context.Read("StageActivityId", "https://AtomicScope.Schemas").ToString());                
 pipelineActivity.LogException(ex);
}



Was this article helpful?