jp.ne.mki.wedge.rule.server.control
クラス ForeachDecisionTable

java.lang.Object
  |
  +--jp.ne.mki.wedge.rule.base.AbstractBase
        |
        +--jp.ne.mki.wedge.rule.base.AbstractServer
              |
              +--jp.ne.mki.wedge.rule.server.control.ForeachDecisionTable
すべての実装インタフェース:
CommonInterface, RuleEngineInterface, ServerInterface, ServerRuleInterface

public class ForeachDecisionTable
extends AbstractServer

Foreachループ処理(デシジョンテーブル実行)


ルールパラメータの物理名のデシジョンテーブルを
複数回呼び出します。
Inに設定したCOLTEXTアイテムの行数分ループ処理が実行され、
処理の各々で、その行のデータをOutのTEXTアイテムに設定します。

例)
InputRecord
アイテム名 データ
COL_ID 0001 0002 0003 0004
COL_名称 AA BB CC DD
OutputRecord
アイテム名 データ
TXT_ID  
TXT_名称  
パラメータ
DECISION_1

実行時の動作
この場合、COLTEXTが四行分のデータがあるため、
四回、DECISION_1の処理が実行されます。

一回目は、TXT_IDに[0001]、TXT_名称に[AA]という文字が設定されます。

以下
二回目:TXT_ID=[0002], TXT_名称=[BB]
三回目:TXT_ID=[0003], TXT_名称=[CC]
四回目:TXT_ID=[0004], TXT_名称=[DD]

と、ループのたびにOutRecordの値を変更しながら動作することとなります。


ループ処理はパフォーマンスの低下に繋がることがございます。
特にループ処理の中でDCやサブトランザクション呼び出しを行うと、
ループのたびに通信処理が動作するため 著しくパフォーマンスが
低下することとなります。

ループを使用しなくて実装が可能な場合は、
極力 ループを使用せずに実装することを推奨します。


例)
アイテム名 データ
ID 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010
名称 AA BB CC DD EE FF GG HH II JJ
種別 1 2 2 1 2 2 1 1 1 2
このデータのうち
種別が1のレコードを テーブル1に追加し、
種別が2のレコードを テーブル2に追加するような
処理を実装することとします。

処理パフォーマンスの悪い実装(ループ処理)

ForeachDecisionTableを使用して、1レコードずつにループを行います。
ループ内で、都度 RunDBServer へ接続をしてSQLを実行します。

このようにすると、最大10回RunDBServerへの接続処理が
動作することとなります。
10回であればさほど処理速度の低下は気にならないかもしれませんが、
これが1000レコード、10000レコードとなると、処理の遅さが
目に見えるかと思われます。

処理パフォーマンスの良い実装(項目郡毎の一括処理)

IfMatchParamThenCopyValueを使用して、レコードを二つの項目郡に分けます。

IfMatchParamThenCopyValueを使って、種別が1のレコードを抽出。
アイテム名 データ
ID_1 0001 0004 0007 0008 0009
名称_1 AA DD GG HH II
種別_1 1 1 1 1 1

IfMatchParamThenCopyValueを使って、種別が2のレコードを抽出。
アイテム名 データ
ID_2 0002 0003 0005 0006 0010
名称_2 BB CC EE FF JJ
種別_2 2 2 2 2 2
その後、これらのデータをそれぞれテーブル1、テーブル2に追加します。
こうするとRunDBServerへの接続は2回のみで済み、
前述した ループの方法と比べた場合、非常に高速に処理ができます。


[I/O RECORD]

InputRecord OutputRecord
  1. Afterに処理を記述したアイテム
  2. COLTEXTデータ(複数指定)
  1. TEXTデータ(複数指定、Inと同数)

[RULE PARAMETER]

Parameter デシジョンテーブル物理名

導入されたバージョン:
1.2.0-04
バージョン:
1.0

クラス jp.ne.mki.wedge.rule.base.AbstractServer から継承したフィールド
serverControlData, wedgeLog
 
クラス jp.ne.mki.wedge.rule.base.AbstractBase から継承したフィールド
controlRecord, engineManager, errorMessage, executeType, id, inputRecord, logicalName, outputRecord, physicalName, ruleParameter, ruleType, serverParameter, userConstant
 
インタフェース jp.ne.mki.wedge.rule.base.interfaces.CommonInterface から継承したフィールド
CANCEL, ERROR, EXECUTE_BOTH, EXECUTE_CLIENT, EXECUTE_DEBUG, EXECUTE_HTMLGATEWAY, EXECUTE_SERVER, EXECUTE_SERVERDC, IO_ERROR, IO_ERROR_EXECUTE_PARAMETER, IO_ERROR_IN, IO_ERROR_IO_MUST_SAME_COUNT, IO_ERROR_ITEM_TYPE, IO_ERROR_OUT, IO_ERROR_PARAMETER, NONE, OK, PARAMETER_DELIMITER, SKIP, USER_ERROR
 
インタフェース jp.ne.mki.wedge.run.interfaces.ServerRuleInterface から継承したフィールド
DTBREAK, DTTYPEBREAK, EXECUTESKIP, EXIT
 
コンストラクタの概要
ForeachDecisionTable()
           
 
メソッドの概要
 int execute()
          処理を実行。
 void exit()
          終了処理。
 int getIOParameter()
          IOパラメータ取得。
 
クラス jp.ne.mki.wedge.rule.base.AbstractServer から継承したメソッド
errorFixed, executeCallStran, executeDecisionTable, executeDecisionTable, executeRule, executeServerDc, executeServerDcChangeConnection, executeServerDcChangeSql, executeServerDcChangeSqlConnection, executeServerRule, getBatchStatus, getExecuteParameter, getJobParameter, getServerControlData, getSkipNumber, getStepParameter, getStepParameter, getTransactionArea, log, setBatchStatus, setExecuteParameter, setServerControlData, setServerStatus, setSkipNumber, setSkipNumber, setThisRuleType, setWedgeLog, showErrorDialog, showErrorDialog, terminate, writeErrorLog, writeErrorLog, writeErrorLog, writeLog, writeLog, writeTraceLog, writeTraceLog
 
クラス jp.ne.mki.wedge.rule.base.AbstractBase から継承したメソッド
callDispose, createErrorMessage, dataClearOfOutRecord, dataClearOfRecord, dispose, getAppAccount, getAppAuthority, getAppMenu, getAppPassword, getClassErrorName, getClientId, getConnectionId, getConnectionPoolId, getConstantKeys, getConstantValue, getConstantValueAsStringArray, getDbAccessCount, getDbErrorCode, getDbErrorMessage, getDbStatus, getDbUpdatedRecordCount, getEngineManager, getErrorMessage, getErrorMessage, getErrorMessage, getExceptionMessage, getExecuteType, getId, getInRecord, getInRecord, getInRecord, getInRecordCount, getIpAddress_G_Index, getIpAddress_P_Index, getLogicalErrorName, getLogicalName, getOutputHtml, getOutRecord, getOutRecord, getOutRecord, getOutRecordCount, getPhysicalErrorName, getPhysicalName, getProjectId, getQueryEndLine, getQueryMaxCount, getQueryPageCount, getQueryStartLine, getReturnString, getRowSize, getRowSizeOfInRecord, getRuleParameter, getRuleParameters, getRuleParameters, getRuleParameters, getRuleType, getRuleTypeName, getServerMessage, getServerParameter, getServerStatus, getServerSubName, getServerSubRevision, getServerTran, getUpdateErrorLine, getUpdateTargetCount, getWebServerIpAddress, isExecutable, isJDK15, logDebug, logError, logError, logFatal, logFatal, logInfo, logTrace, logWarn, logWarn, loopInOutRecord, loopInOutRecordSub, loopInRecord, loopInRecordSub, loopOutRecord, loopOutRecordSub, setControlRecord, setErrorMessage, setErrorMessageMustInRecord, setErrorMessageMustOutRecord, setErrorMessageMustParamIsNumber, setExecuteType, setFatalError, setHtmlManager, setId, setInRecord, setLogicalName, setManager, setOutputHtml, setOutRecord, setPhysicalName, setPropertyFromEngine, setRuleParameter, setRuleType, setServerParameter, setUserConstant, showErrorDialogAddRuleName, writeTraceLog
 
クラス java.lang.Object から継承したメソッド
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース jp.ne.mki.wedge.rule.base.interfaces.CommonInterface から継承したメソッド
dispose, getAppAccount, getAppAuthority, getAppMenu, getAppPassword, getClassErrorName, getClientId, getConnectionId, getConnectionPoolId, getDbAccessCount, getDbErrorCode, getDbErrorMessage, getDbStatus, getEngineManager, getExceptionMessage, getExecuteType, getId, getInRecord, getInRecord, getInRecord, getInRecordCount, getIpAddress_G_Index, getIpAddress_P_Index, getLogicalErrorName, getLogicalName, getOutRecord, getOutRecord, getOutRecord, getOutRecordCount, getPhysicalErrorName, getPhysicalName, getProjectId, getQueryEndLine, getQueryMaxCount, getQueryPageCount, getQueryStartLine, getReturnString, getRuleParameter, getRuleParameters, getRuleType, getRuleTypeName, getServerMessage, getServerParameter, getServerStatus, getServerSubName, getServerSubRevision, getServerTran, getUpdateErrorLine, getUpdateTargetCount, getWebServerIpAddress, isExecutable, logDebug, logError, logError, logFatal, logFatal, logInfo, logTrace, logWarn, logWarn, setExecuteType, setRuleType, setServerParameter, showErrorDialogAddRuleName, writeTraceLog
 

コンストラクタの詳細

ForeachDecisionTable

public ForeachDecisionTable()
メソッドの詳細

getIOParameter

public int getIOParameter()
                   throws java.lang.Throwable
インタフェース CommonInterface の記述:
IOパラメータ取得。execute の前に実行される。
関連項目:
CommonInterface.getIOParameter()

execute

public int execute()
            throws java.lang.Throwable
インタフェース CommonInterface の記述:
処理を実行。
関連項目:
CommonInterface.execute()

exit

public void exit()
          throws java.lang.Throwable
インタフェース CommonInterface の記述:
終了処理。保持していた変数などを開放する処理を記述します。
execute の後に実行されます。
正常終了・異常終了などに関わらず必ず実行されます。
関連項目:
CommonInterface.exit()