Custom Pipelines
- 16 Nov 2022
- 1 Minute to read
- Print
- DarkLight
- PDF
Custom Pipelines
- Updated on 16 Nov 2022
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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
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?