jp.ne.mki.wedge.rule.client.control
クラス ForeachExecuteAfter

java.lang.Object
  |
  +--jp.ne.mki.wedge.rule.base.AbstractBase
        |
        +--jp.ne.mki.wedge.rule.base.AbstractClient
              |
              +--jp.ne.mki.wedge.rule.client.control.ForeachExecuteAfter
すべての実装インタフェース:
ClientInterface, CommonInterface, RuleEngineInterface

public class ForeachExecuteAfter
extends AbstractClient

Foreachループ処理(Afterイベント実行)


In(0)に設定されたアイテムを複数回呼び出します。
In(1)以降に設定したCOLTEXTアイテムの行数分ループ処理が実行され、
処理の各々で、その行のデータをOutのTEXTアイテムに設定します。

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

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

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

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

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


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

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


例)
アイテム名 データ
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レコードずつにループを行います。
ループ内で、都度 サーバ へ接続をしてトランザクションを実行します。

このようにすると、最大10回 トランザクション処理が
動作することとなります。
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に 引き渡します。
こうするとサーバへの接続は2回のみで済み、
前述した ループの方法と比べた場合、非常に高速に処理ができます。

JDK1.5では、CaretのUpdatePolicyを NEVER_UPDATEにしているときに テキストフィールドに対して値を設定をすると、 CaretのRepaintEventが都度発生します。
そのため、ループ処理で何度もテキストフィールドの値を更新すると、 OutOfMemoryErrorが発生することがございます。
(OutOfMemoryError はログ出力中にエラーが発生することがあるため、 ログに正常に出力されない場合もあります。ご注意下さい。)

この問題に対応するためには、ループ処理の実行前に
SetCaretUpdatePolicyをを使用して、 UpdatePolicyを NEVER_UPDATEにして下さい。
(テキストフィールドの挙動が変わるため、 SetCaretUpdatePolicyのパラメータに-tempを指定してください。)


[I/O RECORD]

InputRecord OutputRecord
  1. イベントアイテム
  2. COLTEXTデータ(複数指定)
  1. TEXTデータ(複数指定、InのCOLTEXTデータと同数)

[RULE PARAMETER]

Parameter

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

フィールドの概要
(パッケージプライベート)  java.util.List caretReturnRunnables
           
 
クラス 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.ClientInterface から継承したフィールド
FRAME_CLOSE, FRAME_QUIT, SKIP_ALL, STOP, STOP_SELECT_ALL, SYSTEM_EXIT, SYSTEM_QUIT, TIMING_AFTER, TIMING_BEFORE, TIMING_LOAD, TIMING_ROW_CLICK, TIMING_ROW_WCLICK, TIMING_UN_LOAD
 
インタフェース 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
 
コンストラクタの概要
ForeachExecuteAfter()
           
 
メソッドの概要
 int execute()
          処理を実行。
 void exit()
          終了処理。
 int getIOParameter()
          IOパラメータ取得。
 
クラス jp.ne.mki.wedge.rule.base.AbstractClient から継承したメソッド
executeCurrentAfter, executeRule, executeRule, getAdapterName, getClientRuleObject, getCodeBase, getComponent, getComponent, getComponents, getConfig, getConfImagePath, getContentPane, getCurrentComponent, getDesktop, getExecuteIndex, getExecuteParameter, getExecuteTiming, getExecutions, getExpectNextComponent, getFrame, getFrameRunner, getImageIcon, getInItem, getInItem, getItems, getManager, getMemory, getOutItem, getOutItem, getParameter, getReturnString, getRevision, isApplet, isApplication, isClientTraceMode, isConpiled, isJWS, isServerTraceMode, isWeb, log, loopInItem, loopInItemSub, loopInOutItem, loopInOutItemSub, loopOutItem, loopOutItemSub, setErrorMessageMustInComp, setErrorMessageMustOutComp, setExecuteParameter, setFocus, setFocus, setFocus, setFrameRunnerErrorStatus, setManager, setPropertyFromEngine, setStatusBarText, setWedgeLog, showDocument, showErrorDialog, showErrorDialog, showFrame, showFrame, showFrame, showFrame, terminate, writeErrorLog, writeErrorLog, writeErrorLog, writeErrorLog, writeLog, writeLog, 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, getRowSize, getRowSizeOfInRecord, getRuleParameter, getRuleParameters, getRuleParameters, getRuleParameters, getRuleType, getRuleTypeName, getServerMessage, getServerParameter, getServerStatus, getServerSubName, getServerSubRevision, getServerTran, getUpdateErrorLine, getUpdateTargetCount, getWebServerIpAddress, isExecutable, isJDK15, log, 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, setOutputHtml, setOutRecord, setPhysicalName, setRuleParameter, setRuleType, setServerControlData, 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, 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
 

フィールドの詳細

caretReturnRunnables

java.util.List caretReturnRunnables
コンストラクタの詳細

ForeachExecuteAfter

public ForeachExecuteAfter()
メソッドの詳細

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()