Orchestration Helpers
  • 22 Aug 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Orchestration Helpers

  • Dark
    Light
  • PDF

Article summary

To use Atomic Scope helpers in orchestrations, you can refer the following assemblies into your orchestration project as shown below. These DLLs will be present in the folder location \AtomicScope\Binaries folder on a machine where Atomic Scope BizTalk runtime components are installed.

image.png

AtomicScope.BizTalk and AtomicScope.PropertySchema are two required DLLs for building orchestration.

Create a couple of variables as shown in the image

image.png

VariableType
varActivityRequestAtomicScope.BizTalk.ActivityRequest


Once the variables are created, you can use the orchestration helpers as below.

image.png

You will have to initialize the variables and call start activity in an expression shape. At this point, the stage defined in the request will be started. We recommend doing this at the beginning of an orchestration.

//***************************************
//Atomic Scope activity logging - Start
//***************************************
varOrchestrationActivityLogger = new  AtomicScope.BizTalk.OrchestrationActivity();

//Create Atctivity request object
varActivityRequest = new AtomicScope.BizTalk.ActivityRequest();

//Set activity request properties
varActivityRequest.OriginalMessage = msgInboundOrder;
varActivityRequest.StageName = "Orch_SingleOrchestration";

//Start activity
varOrchestrationActivityLogger.Start(varActivityRequest);

However, a single orchestration can have multiple stages. In that case, start activity will be called at various places in the same orchestration.

Any logic after start activity is a business logic. You need to use a message assignment shape in a construct shape to set the Current Stage. Setting the current stage is important for the next stage to know the previous stage of the message. You can use this in any of the existing construct shapes in your business logic.

msgOutboundOrder = msgInboundOrder;
msgOutboundOrder(*) = msgInboundOrder(*);
msgOutboundOrder(BTS.DestinationParty) = "SingleOrchestration";
msgOutboundOrder(AtomicScope.PropertySchema.CurrentStage) = "Orch_SingleOrchestration";

Update the activity to complete the stage. You can also use the archive method as shown below.
You can log either business exception or system exception as shown below.

varOrchestrationActivityLogger.Update();
varOrchestrationActivityLogger.Archive(msgOutboundOrder);

Was this article helpful?