Tutorial.ExampleOperation の作成
VS Code - ObjectScript を使用して Tutorial.ExampleOperation を作成する手順は次のとおりです。
-
ワークスペース (多くの場合、名前は src) のソース・コード・フォルダに Tutorial フォルダがない場合は、ここで追加します。
-
ExampleOperation.cls を名前とする新しいファイルを Tutorial フォルダに追加します。
-
以下のコードを入力します。
Class Tutorial.ExampleOperation extends Ens.BusinessOperation { Parameter INVOCATION = "Queue"; 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 } } XData MessageMap { <MapItems> <MapItem MessageType="Ens.StringRequest"> <Method>Test</Method> </MapItem> </MapItems> } }