Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

<default>

<switch> 要素内に一致する条件が見つからない場合に、一連のアクティビティを実行します。

Synopsis

<switch>   <case>     ...   </case>   ...   <default>     ...   </default> </switch>

詳細

属性または要素 説明
namedisabledxposyposxendyend 属性 "一般的な属性と要素" を参照してください。name のデフォルト値は "Default" です。
<annotation> 要素
その他の要素 オプション。<default> には、<alert>、<assign>、<branch>、<break>、<call>、<code>、<continue>、<delay>、<empty>、<flow>、<foreach>、<if>、<label>、<milestone>、<reply>、<rule>、<scope>、<sequence>、<sql>、<switch>、<sync>、<throw>、<trace>、<transform>、<until>、<while>、<xpath> および <xslt> をゼロ個以上、自由に組み合わせて使用できます。

説明

<switch> 要素には、連続する 1 つ以上の <case> 要素と、オプションの <default> 要素が含まれます。

<default> 要素を使用する場合は、<switch> 内の最後の要素として記述する必要があります。同様に、ビジネス・プロセス・デザイナのダイアログラムでは、<switch> 部分の右端のオプションとして <default> 要素を追加する必要があります。

<switch> 要素が実行されると、さらに各 <case> 条件が評価されます。これらの条件は、それを含む <process> 要素のスクリプト言語で記述された論理式です。いずれかの式の結果が整数値 1 (真) の場合、それに対応する <case> 要素の内容が実行されます。それ以外の場合は、次の <case> 要素の式が評価されます。

どの <case> 条件も真でない場合は、<default> 要素の内容が実行されます。

<default> 要素内では、前述のいずれかの BPL アクティビティを使用できます。以下の例では <assign> 要素を使用しています。

<switch name='Approved?'>
  <case name='No PrimeRate' condition='context.PrimeRate=""'>
    <assign name='Not Approved' property="response.IsApproved" value="0"/>
  </case>
  <case name='No Credit' condition='context.CreditRating=""'>
    <assign name='Not Approved' property="response.IsApproved" value="0"/>
  </case>
  <default name='Approved' >
    <assign name='Approved' property="response.IsApproved" value="1"/>
    <assign name='InterestRate'
            property="response.InterestRate"
            value="context.PrimeRate+10+(99*(1-(context.CreditRating/100)))">
      <annotation>
        Copy InterestRate into response object.
      </annotation>
    </assign>
  </default>
</switch>
FeedbackOpens in a new tab