自動フォルト・リカバリに対するフォルト・ポリシー・ファイルの手動作成
自動フォルト・リカバリに対するフォルト・ポリシー・ファイルを手動で作成するには:
ノート:
あらかじめシードされているリカバリ・アクションのタグ名(ora-retry
、ora-human-intervention
、ora-terminate
など)は、単なるサンプルです。これらの名前は各自の環境に適した名前に置換できます。
condition
、action
およびalert
のセクションが完全に定義されているフォルト・ポリシー・ファイルは、次のようになります。
ノート:
-
フォルト・ポリシー・ファイルの名前は、単一の固有名に限定されているわけではありません。ただし、これらの名前は、
fault-policy.xsd
スキーマ・ファイルに準拠している必要があります。 -
このフォルト・ポリシー・ファイルは、フォルト名に基づいてフォルトを捕捉する例を示しています。フォルトは、メッセージ・タイプまたはフォルト名(あるいはその両方)に基づいて捕捉することもできます。
<faultName name="myfault" type="fault:faultType">
<?xml version="1.0" encoding="UTF-8"?> <faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <faultPolicy version="2.0.1" id="ModifyAndRecover" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Conditions> <!-- Handle remoteFault system exceptions --> <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:remoteFault"> <condition> <!--<test>$fault.code="1"</test>--> <alert ref = "ora-jms"/> <alert ref = "ora-email"/> <action ref="default-human-intervention"/> </condition> </faultName> <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:bindingFault"> <condition> <action ref="default-human-intervention"/> </condition> </faultName> </Conditions> <Alerts> <Alert id="ora-email"> <email> <To>joe.smith@example.com</To> <CC>joe.smith@example.com</CC> </email> </Alert> <Alert id="ora-jms"> <JMS propertySet="jms-props"> <Headers> <property name="correlationId">myvalue</property> <property name="correlationId1">myvalue1</property> </Headers> </JMS> </Alert> </Alerts> <Actions> <!-- Generics --> <Action id="default-terminate"> <abort/> </Action> <Action id="default-replay-scope"> <replayScope/> </Action> <Action id="default-rethrow-fault"> <rethrowFault/> </Action> <Action id="default-human-intervention"> <humanIntervention/> </Action> <Action id="ora-retry-with-human-intervention"> <retry> <retryCount>1</retryCount> <retryInterval>2</retryInterval> <exponentialBackoff/> <retryFailureAction ref="default-terminate"/> </retry> </Action> </Actions> <Properties> <propertySet name="jms-props"> <property name="jmsDestination">MyQueue</property> <property name="connectionFactory">jms/fabric/ehconnectionfactory</property> </propertySet> </Properties> </faultPolicy> </faultPolicies>