CSP page for viewing the FOP Queue items via SQL User vhLib.Macro cache 0 %CSP.Page 1 code QItemID cache %String 1 code iTask,iTSeq cache %String 1 code arIDs,NewQStatus cache %String nothing will happen to items in status "H" For Set tmpID=$O(arIDs($$$qaUPDATE,tmpID)) Quit:(tmpID="") Do . Set QItem=##class(BL.Sys.FOP.Scheduler).OpenQItem(tmpID) . Set sc=QItem.UpdateStatus(NewQStatus,1) . Set QItem="" . ;Set sc=$$$OK . If $$$ISERR(sc) Do . . Set arIDs($$$qaUPDATE,tmpID)="ERROR" . . Set arIDs("LOG",$$$qaUPDATE,tmpID)=$$ParseStatus^vhLib(sc) . . Set arIDs($$$qaSELECT,tmpID)="" Set QItem="" Quit "" ]]> 1 code %Status 1 code %Boolean " Write !,(..HyperEventBody()) Write !,$c(9) #include vhLib.Macro Write !,$c(9)_"

"_($$$UCase($G(CspPageTitle,..%ClassName(0)))_" "_$G(OnServer))_"

",! If '(($D(arIDs))) Goto %csp00001 ;{ Write !,$c(9)_"

Deze items zijn reeds "_($S(Act=$$$qaDELETE:"verwijderd van de Queue", Act=$$$qaMOVE:"verplaatst naar QueueArchive", Act=$$$qaSELECT:"geselecteerd", Act=$$$qaUPDATE:"geüpdatet naar de nieuwe status"_$S($L($G(NewQStatus)):" ("_NewQStatus_")", 1:""), 1:"???"))_".

",! Write $c(9)_"
"_($$ArrayToText^vhLib("IDs",.arIDs))_"
",! %csp00001 ;} Write $c(9),! Write !,$c(9)_"
",! Write $c(9)_"

",! Write $c(9,9)_"RunMode: Batch, Threaded, InLine (via Scheduler) - Synchronous (immediately)
",! Write $c(9,9)_"Status : [W]ait -- [S]tarted -- [B]usy -- [P]rocessed -- [F]inished -- " Write "" Write "[E]rror" Write "" Write " -- [Y]:Synchronous -- [H]: on Hold
",! Write $c(9)_"

",! Write $c(9) // Open instance of ResultSet for runtime mode of DISPLAY. Set queryA = ##class(%ResultSet).%New() Set queryA.RuntimeMode=2 Set sqlStatement=$zstrip($tr((sqlActive),$C(9,13,10)," "),"<>W") If $zcvt($extract(sqlStatement,1,6),"U")'="SELECT" { Do ..ShowError($$$ERROR($$$CSPSQLOnlySelect,100)) Quit } // translate tab/cr/nl to spaces Set %sc = queryA.Prepare(sqlStatement,0,"RUNTIME") If (+%sc=0) { Do ..ShowError(%sc) QUIT } Set %sc = queryA.Execute(($G(%request.Data("P1",1),"A"))) If (+%sc=0) { Do ..ShowError(%sc) QUIT } Write !,$c(9) Set qryAColCount=queryA.GetColumnCount() Write !,$c(9) Write "
" Write !,..InsertHiddenFields(""),! Write !,$c(9)_"

" Write "" Write "

",! Write $c(9)_"",! Write $c(9,9)_""_$c(9,9),! Write $c(9,9,9)_""_$c(9,9,9),! Write $c(9,9,9) Set col=0 %csp00003 If '((col"_$c(9,9,9),! Write $c(9,9,9) Goto %csp00003 %csp00002 ;} Write !,$c(9,9)_""_$c(9,9),! Write $c(9,9) Kill arColSpecial Set blnAddLink=0 Set blnAddChk=(blnSHOWCHK)&&(blnSqlArchive=0) Set QSqueue=$S(blnSqlArchive:"QARCH", 1:"QITEM") Write !,$c(9,9)_"",! Write $c(9,9,9)_"",! Write $c(9,9,9) Set col=0 %csp00005 If '((col"_(ColumnName)_"",! Write $c(9,9,9) Goto %csp00005 %csp00004 ;} Write !,$c(9,9)_"",! Write $c(9,9) Set row=0 %csp00007 If '(queryA.Next()) Goto %csp00006 ;{ Set row=row+1 Write " " Write !,$c(9,9)_"",! Write $c(9,9,9)_"",! Write $c(9,9,9) Set col=0 %csp00009 If '((col"_tmpVal_"" Write !,$c(9,9,9)_"",! Write $c(9,9,9) Goto %csp00009 %csp00008 ;} Write !,$c(9,9)_"",! Write $c(9,9) Goto %csp00007 %csp00006 ;} Write !,$c(9)_"
 
"_($S(blnAddChk:"", 1:" "))_""_($S($L(tmpVal):tmpVal,1:" "))_"
",! Write $c(9) Write "" Write !,$c(9)_"

",! Write $c(9,9) Write "" Write "  ",! Write $c(9,9) Write "" Write !,$c(9,9) Write "" Write !,$c(9,9) Write "" Write !,$c(9,9) Write "" Write "New Status : " Write "" Write "" Write " " Write "" Write !,$c(9)_"

",! Write $c(9)_"

"_$c(9),! Write $c(9,9)_"OPGELET:
",! Write $c(9,9)_"De acties worden ONMIDDELLIJK uitgevoerd op de geselecteerde QItems.
",! Write $c(9,9)_"Deze kunnen dan ook niet ongedaan gemaakt worden!!!",! Write $c(9)_"

",! Write $c(9) Write "
" Write !,$c(9) Write "
" Write !,$c(9,9)_"

",! Write $c(9,9,9) Write "" Write !,$c(9,9,9) Write "" Write !,$c(9,9)_"

",! Write $c(9) Write "
" Write !,"" ]]>
1 code %Boolean 1 code %Boolean " Write ! Set BodyBgColor=##class(TECH.Config.ConfigMgr).Instance().GetString("WebpaginaAchtergrondKleur") Set OnServer = "  ["_$$$NSpace_"]" Write !,$c(9)_""_($G(CspPageTitle,..%ClassName(0))_$G(OnServer))_"",! Write $c(9) Write "" Write $c(9),! Write $c(9) Write "" Write ! Do ..Include("incMsgBoxCustomVB.csp") Write !,!,$c(9) Write "" Write !,!,$c(9) Write "" Write !,(..HyperEventHead()) Write !,!,"" ]]> 1 code %Boolean " Write !,! Do ..OnPageHEAD() Write !,! Do ..OnPageBODY() Write !,"" ]]> 1 code %Boolean 1 code %Boolean 1 code cache %Boolean '||"_%v_"||'') "_%v #define CvtNOBRhtml(%v) "('<NOBR>'||"_%v_"||'</NOBR>') "_%v ;d WLIP^vhDBG(97,"Fop Queue Mgr - OnPreHTTP") /*** INPUT PARAMETERS ***/ /*** ================ ***/ ; Request Parameters Set name="" For Set name=$O(%request.Data(name)) Quit:(name="") Merge tmpRq(name)=%request.Data(name,1) ;d WL^vhDBG($$$ArrayTT2("tmpRq",.tmpRq)) Set QAction=$G(tmpRq("QACTION")) If QAction="ASK" Do . Set Act=$$$qaSELECT Else If QAction="GO" Do . Set Act=$$$qaSELECT . Set:($L($G(tmpRq("DeleteIDs")))) Act=$$$qaDELETE . Set:($L($G(tmpRq("MoveIDs")))) Act=$$$qaMOVE . Set:($L($G(tmpRq("UpdateIDs")))) Act=$$$qaUPDATE Set NewQStatus=$G(tmpRq("NewQStatus"),"H") Set blnShowQItemsWait=$G(tmpRq("ShowQIW")) Set blnShowQItemsWait=(blnShowQItemsWait)||(($G(Act)=$$$qaUPDATE)&&(NewQStatus="W")) ; d WL^vhDBG("ShowQIW: "_blnShowQItemsWait) Set i="" For Set i=$O(%request.Data("idQI",i)) Quit:(i="") Do . Set tmpID=($G(%request.Data("idQI",i))) . Quit:(tmpID="") . Set arRqIDs(tmpID)=i . Set arIDs(Act,tmpID)="" Do ..ManageQIDs(.arIDs,NewQStatus) ; Delete/Move/Update QItems specified by arIDs Set blnFOPNOW=1 Set blnFOPARCHIVE=0 Set blnFOPCNT=0 Set blnSQED=0 Set blnSHOWCHK=1 Set lbHideStatus=$LB("W") Set:(blnShowQItemsWait) lbHideStatus=$LB("??") Set HideStatusList=$TR($$LCVTXTD^vhLib(lbHideStatus,"(,)","",1),"""","'") /*** SQL STATEMENTS ***/ /*** ============== ***/ ; SQL-statement for FOP Queue Set sqlFOP="SELECT Top 100 ID,Status,Priority,RunMode,Task,Task->KeyWords As Task_KeyWords, Created,Started,Finished,(InternePersoonInits || ' - ' || InternePersoon) As InternePersoon " Set sqlFOP=sqlFOP_$C(13,10)_" FROM Sys_FOP.TaskQueue WHERE (ID > 1) "_$S($L(HideStatusList):" AND (Status NOT in "_HideStatusList_") ", 1:"") Set sqlFOP=sqlFOP_$C(13,10)_" ORDER BY StatusNum DESC, ID, Priority DESC " ; SQL-statement last three IDs Set sqlTOP3="SELECT top 3 ID FROM Sys_FOP.TaskQueue ORDER BY ID Desc" ; SQLs to be displayed Set sqlDFL=$S(blnFOPNOW:sqlFOP, 1:sqlTOP3) Set sqlActive=sqlDFL Set blnSqlArchive=0 ; ($$$CvtSqlMatch(sqlActive)[$$$CvtSqlMatch("FROM Sys_FOP.QueueArchive")) Set ShowTask=0 ; Check if SQL-statement does not alter the tables data !!! Set lbAvoidSQL=$LB("CREATE TABLE","ALTER TABLE","DROP TABLE","CREATE QUERY","DROP QUERY","INSERT","UPDATE","DELETE") Set CspPageTitle="FOP Queue - Manage items" Quit 1 // Oproepen via // s sc=##class(BL.Flow.Levering.Doc).RenderAndPrintDocViaType(362112,"BonGeel","LEVBON_WV") w sc,! // ]]> 1 code MaxDiff cache %String c:\cachesys\csp\admin1\FOPQueueMgr.csp /csp/admin1/FOPQueueMgr.csp 62105,37185