...
Parameter | Type | Prompt | Value |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Prolog (before Initialize Logging region)
Code Block |
---|
pLogOutput = TRIM( pLogOutput );
nLogOutput = StringToNumber( If( pLogOutput @= '', '0', pLogOutput )); |
Prolog (declarations):
Code Block |
---|
cCubParam = '}APQ Settings'; cDimPar = 'FIN Company'; cCubThreadCtrl = '}APQ C3 Thread Control'; cDimensionDelim = CellGetS( cCubParam, 'pDimDelim', 'String' ); cElementStartDelim = CellGetS( cCubParam, 'pEleStartDelim', 'String' ); cElementDelim = CellGetS( cCubParam, 'pEleDelim', 'String' ); |
Prolog (after declarations):
...
Code Block |
---|
If ( nMaxThreads > 1 & nThreadID >= 0 ); # Parallel processing nThreads = nMaxThreads; If ( nThreadID = 0 ); # This is master - spawn worker threads. Master will be also processing data. sThreads = NumberToString( nThreads ); sMessage = Expand( 'Data processing will run on %sThreads% thread' | If( nThreads > 1, 's', '') | '.' ); sSequenceID = NumberToString( nMultiMsgJSON ); sMessageJSON = INSRT(' "message":"', sMessage | '"', 1); sMultiMsg = Expand( '%sMultiMsg%' | If(LONG(sMultiMsg)=0, '', ', ') | '"' | NumberToString( nMultiMsgJSON ) | '":{%sMessageJSON%}' ); nMultiMsgJSON = nMultiMsgJSON + 1; LogOutput( 'Info', sMessage ); sFilter = '}Clients' | cElementStartDelim | cUserName; sFilter = sFilter | cDimensionDelim | '}Processes' | cElementStartDelim | cThisProcName; sProc = '}bedrock.cube.view.create'; nRet = ExecuteProcess( sProc, 'pLogOutput', nLogOutput, 'pCube', cCubThreadCtrl, 'pView', cViewClr, 'pFilter', sFilter, 'pSuppressConsol', 1, 'pSuppressRules', 0, 'pDimDelim', cDimensionDelim, 'pEleStartDelim', cElementStartDelim, 'pEleDelim', cElementDelim, 'pTemp', 1 ); IF( nRet <> ProcessExitNormal ); nErrors = nErrors + 1; sRet = NumberToString( nRet ); sMessage = Expand( 'Call to %sProc% has finished with errors (code = %sRet%).' ); sSequenceID = NumberToString( nMultiMsgJSON ); sMessageJSON = INSRT(' "message":"', sMessage | '"', 1); sMultiMsg = Expand( '%sMultiMsg%' | If(LONG(sMultiMsg)=0, '', ', ') | '"' | NumberToString( nMultiMsgJSON ) | '":{%sMessageJSON%}' ); nMultiMsgJSON = nMultiMsgJSON + 1; LogOutput( cMsgErrorLevel, Expand( cMsgErrorContent ) ); ProcessBreak; EndIF; ViewZeroOut( cCubThreadCtrl, cViewClr ); CellPutN( 1, cCubThreadCtrl, cUserName, cThisProcName, pThreadID, 'scheduled' ); CellPutN( 1, cCubThreadCtrl, cUserName, cThisProcName, pThreadID, 'running' ); CellPutN( 0, cCubThreadCtrl, cUserName, cThisProcName, pThreadID, 'completed' ); nThread = 1; While ( nThread < nThreads ); sThreadID = NumberToString( nThread ); CellPutN( 1, cCubThreadCtrl, cUserName, cThisProcName, sThreadID, 'scheduled' ); nThread = nThread + 1; End; CubeSaveData( cCubThreadCtrl ); nThread = 1; While ( nThread < nThreads ); sThreadID = NumberToString( nThread ); RunProcess( cThisProcName, 'pLogOutput', pLogOutput,# TODO: Add proper parameters - all are passed through 'pVersion'RunProcess( cThisProcName, pVersion, 'pYearpLogOutput', pYear, 'pCompany', pCompany, 'pBSEG1', pBSEG1, 'pBSEG2', pBSEG2, 'pBSEG3', pBSEG3pLogOutput, 'pBSEG4', pBSEG4, 'pThreadID', sThreadID, 'pDimPar', pDimPar, 'pMonthFrom', pMonthFrom, 'pMonthTo', pMonthTo, 'pMaxThreads', pMaxThreads, 'pReattachRule', '0' ); nThread = nThread + 1; End; Else; CellPutN( 1, cCubThreadCtrl, cUserName, cThisProcName, pThreadID, 'running' ); CellPutN( 0, cCubThreadCtrl, cUserName, cThisProcName, pThreadID, 'completed' ); EndIf; EndIf; |
...