Skip to main content

This documentation is for an older version of this product. See the latest version of this content.Opens in a new tab

Tutorial.ExampleOperation の作成

VS Code - ObjectScript を使用して Tutorial.ExampleOperation を作成する手順は次のとおりです。

  1. ワークスペース (多くの場合、名前は src) のソース・コード・フォルダに Tutorial フォルダがない場合は、ここで追加します。

  2. ExampleOperation.cls を名前とする新しいファイルを Tutorial フォルダに追加します。

  3. 以下のコードを入力します。

    
    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>
    }
    
    }
    
    
FeedbackOpens in a new tab