Creating Tutorial.ExampleOperation
Here are the steps for creating Tutorial.ExampleOperation using Atelier:
-
Create an Atelier project using an interoperability-enabled namespace. Use the namespace in which you created Tutorial.ExampleProduction.
-
Launch the new Business Operation Wizard: click File > New > Class File. Select the Business Operation template.
-
Enter the following information into the wizard.
-
Project: the name of your project.
-
Package: Tutorial
-
Name: ExampleOperation
-
Invocation Style: Queued
-
Operation Methods:
-
Name: Test
-
Request Type: Ens.StringRequestOpens in a new tab
-
Response Type: Ens.StringResponseOpens in a new tab
-
-
-
Click Finish
-
Add the following code to the Test method:
Method Test(pRequest As Ens.StringRequest, Output pResponse As Ens.StringResponse) As %Status{ Set pResponse=##class(Ens.StringResponse).%New() if (pRequest.StringValue="") { Set pResponse.StringValue="ERROR" Set tSC=$$$ERROR($$$GeneralError, "Test error case") } else { Set pResponse.StringValue="OK" Set tSC=$$$OK } $$$LOGINFO(pResponse.StringValue) Return tSC }
-
The complete code for Tutorial.ExampleOperation should look like the following:
Class Tutorial.ExampleProduction extends Ens.BusinessOperation { Parameter INVOCATION = "Queue"; Method Test(pInput As Ens.StringRequest, Output pOutput As Ens.StringResponse) As %Status { Set pResponse=##class(Ens.StringResponse).%New() if (pRequest.StringValue="") { Set pResponse.StringValue="ERROR" Set tSC=$$$ERROR($$$GeneralError, "Test error case") } else { Set pResponse.StringValue="OK" Set tSC=$$$OK $$$LOGINFO(pResponse.StringValue) Return tSC } } XData MessageMap { <MapItems> <MapItem MessageType="Ens.StringRequest"> <Method>Test</Method> </MapItem> </MapItems> } }