Hi Joel,
solved it in the evneing by switching the processes and using filters.
30 hours turned into 30 seconds.
Old Code:
:SET &PROC_REP# = PREP_PROCESS_REPORT(,,,)
:PROCESS &PROC_REP#
: SET &LINE# = GET_PROCESS_LINE(&PROC_REP#)
: SET &PROC_SQLSTATE# = PREP_PROCESS_VAR(&UC4_VARA#,,'*')
: PROCESS &PROC_SQLSTATE#
: SET &T_STATE# = GET_PROCESS_LINE(&PROC_SQLSTATE#,1)
: SET &T_WERT# = GET_PROCESS_LINE(&PROC_SQLSTATE#,2)
: IF STR_FIND(&LINE#,&T_STATE#) > 0
: IF &T_WERT# <> 0
: SET &RC# = &T_WERT#
: ENDIF
: PRINT '&LINE#'
: PRINT '+ Treffer Begriff/Wert: &t_state# / &t_wert#'
: PRINT '+----------------------------------------------------------------+'
: ENDIF
: ENDPROCESS &PROC_SQLSTATE#
: CLOSE_PROCESS &PROC_SQLSTATE#
:ENDPROCESS &PROC_REP#
:CLOSE_PROCESS &PROC_REP#
New Code
:SET &PROC_SQLSTATE# = PREP_PROCESS_VAR(&UC4_VARA#,,'*')
:PROCESS &PROC_SQLSTATE#
: SET &T_STATE# = GET_PROCESS_LINE(&PROC_SQLSTATE#,1)
: SET &T_WERT# = GET_PROCESS_LINE(&PROC_SQLSTATE#,2)
: SET &PROC_REP# = PREP_PROCESS_REPORT(,,,"*&T_STATE#*")
: PROCESS &PROC_REP#
: SET &LINE# = GET_PROCESS_LINE(&PROC_REP#)
: SET &RC# = &T_WERT#
: PRINT '&LINE#'
: PRINT '+ Treffer Begriff/Wert: &t_state#) / &t_wert#)'
: PRINT '+----------------------------------------------------------------+'
: ENDPROCESS &PROC_REP#
: CLOSE_PROCESS &PROC_REP#
:ENDPROCESS &PROC_SQLSTATE#
:CLOSE_PROCESS &PROC_SQLSTATE#
The old one got every row of the report and checked ist with findstr against every row from the 2.nd VARA.
The new one processes the vara and uses its content as filter for processing the report.
both methods deliver the same results, but the 2nd seems to be much more efficient.
Also there are no infinite loop messages anymore.
Original Message:
Sent: Jul 03, 2024 01:47 AM
From: Joel Wiesmann
Subject: How to avoid: "processing interrupted, possible loop!"?
Hi Bastian
If it's a simple "contains" / "not contains" logic you need to execute, you might use FILTER objects to modify the returncode. The changed returncode can then be used for further logic either in the post process, the workflow task postconditions or the succeeding workflow task (time & dependency settings).
If you have a more complex requirement, please add some more details what you want to achieve with the filter matches. There are a lot possible ways to act on this and workaround your issue :-).
Regards
Joel
------------------------------
☎️ Swisscom Automation Engineer & 🧙 PE Membership Creator
Automic Kurse, Tutorials, Tools und mehr auf:
https://membership.philippelmer.com/
Zwei Wochen kostenlos testen!
Original Message:
Sent: Jul 02, 2024 04:40 AM
From: Bastian Fischer
Subject: How to avoid: "processing interrupted, possible loop!"?
Hello there,
i´m getting trouble with the automatic loop detection slowing down a script.
We´re using Version 12.3.
What do I want to do?
I´ve got a report that have to be scanned for several Keyword (64 different sentences) stored in an VARA object.
in Postprocessing i´m using prep_process_report to read every line of the Report.
Solution 1:
while in prep_process_report, I started prep_process_var for every line of the report.
This leads into interrupted processing because of possible loops.
Solution 2:
To Avoid lots of prep_process_var, I´ve stored the vaules of the VARA into an Array.
While in prep_process_report, I started while....done for every filed of the array.
This leads into interrupted processing because of possible loops.
I´ve no Idea how to deal with this problem.
The interrupts are messy an depending on the size of the report, my runtime explodes up the 32 hours.
Any hints or ideas?