Webreports :BREAK function using OScript
Hello All,
I believe this ask goes beyond base functionality, so I have to assume an OScript solution is my best bet. Wondering if anyone has toyed with the idea of a WebReport tag that would prematurely stop execution? Conceptually similar to a BREAK line in an IF/switch statement, only it would 'kill' the executing WebReport. As I understand it, it is not possible to kill a process running on a thread after it has started, but what if the kill command was built into the process?
Here is a hypothetical use-case:
- We have a Webreport with a LiveReport source that returns x rows of one column.
- In between STARTROW/ENDROW, the data in this column is concatenated into a comma-separated list: [LL_REPTAG_!concatList /].
- After STARTROW/ENDROW, we enter an IF that checks the length of this list. If the list is empty, run the :BREAK and stop executing.
- If the list isn't empty, continue to execute to completion.
I don't want to complicate the hypothetical too much to early, but for my purposes it would also be ideal if the command circumvented the destination settings of the WebReport. For example, if the destination is set to 'Workflow', we don't want to start the workflow if the kill statement runs.
Any info/suggestions you can provide is appreciated.
Regards.
Answers
-
Hi,
There is an EXITIF Content Control tag that stops processing rows when a condition is met.
[LL_WEBREPORT_EXITIF "" == "" /]
It does not kill the thread, it merely stops looping through rows. There are other such tags that control row execution - you can find these tags in the tag guide along with references to related tags.
It should be noted that the data source is not affected by these tags as the data source runs before any WebReports source code is run.
There are other ways to manage this, but from your description I think this meets your needs.
We provide training on WebReports from the basics to advanced (Using builder) development and support.
Happy to discuss training tailored to your, or your company's needs as we developed the original WebReports training.
Greg Petti - gpetti@ravenblackts.com.
1 -
Although it would be nice to have this as a feature, I think it can be achieved by using [LL_WEBREPORT_IF /] tag after ENDROW. Example:
[LL_WEBREPORT_IF "[LL_REPTAG_!concatList LENGTH /]" > "0" /]
- - do further processing
[LL_WEBREPORT_ENDIF /]
Just my 2cents.
0 -
Now that it got Greg's attention, you should see that soon in his subtag suite 😀
0 -
LOL,
You can also use: _INCLUDEIF (specifically designed for Row Sections.
there is also RUNIF but that is designed to stop a WebReport from running in the first place (based on a condition).
I still can't quite see a unique part of this feature that isn't already covered but if I do, defs a new sub-tag.
Greg
0 -
@GregPetti - I think the new sub-tag could be something similar to return statement in programming languages. So it will outputs until that point.
0 -
I see. I think the ExitIf might solve this particular problem but I have considered a return feature before. Unfortunately, to do it in a sub-tag (without changing any of the WebReports code) is problematic, possibly even impossible. I think eventually we (Ravenblack) will start developing an extended version of WebReports where we can extend features without drop-in sub-tags. This would be one obvious new feature. A While loop is another one that has been suggested.
1
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories