I am running Content Server 25.2 with PostGres. I have written a WEBReport to trigger when a new Business Workspace is added to a folder in the system to create the Parent/Chlld relationship to other Workspaces. The source of the WebReport is a LiveReport that queries the llattrdata table for a matching value and then returns the dataid for that object (there will only be one that is returned), then the webreport is suppose to use that value to create a PARENT relationship. The query runs as expected and provides the correct response, however when the WebReport fires it returns "WKSPACTION: Unable to retrieve node specified". When I perform the same action where I hardcode the same values in the report it executes fine and creates the relationship. It seems to be something with the variable. Has anyone come across this before, what am I missing (or doing incorrectly)?
If there are Accepted Answers, those will be shown by default. You can switch to 'All Replies' by selecting the tab below.
Code looks correct; the if portion is basically the footer of the WR.Try to do some debugging
So, in your if block before the WR code is running I would write
DEBUG Got TRIGGERID : LL_REPTAG_triggerid is [LL_REPTAG_triggerid /]
DEBUG Got PARENTID: LL_REPTAG_!WPParentid is [LL_REPTAG_!WPParentid /]
and make the WR write this to a file or email, and see if anything is amiss.
The code would run the loop, so if there is a row returned from your query that overwrites what you think it is there
By echoing the footer variables, you can see what the final WPParentid variable is
You can also, in postgres say return only one row so that there will only be one row returned
PS: If you turn Content Intelligence off in your settings, the IF block will automatically move to the footer. That way, you know kind of what is running in the loop and once per WR. Also please use your due diligence, as I wrote this based on your screencap and so get the variable printing correct
It seems to be the variable is NOT being passed from the LiveReport:
However if I runt the LiveReport directly it does show the value
How is the NodeID passed to the LiveReport?
Is your trigger for Node Created or for Workspace Created? If you use Node Created, it may that LLAttrData is not filled yet.
I would use the RUNSQL tag to run the LiveReport. The name of the URL parameter in the LiveReport should be inputlabel1.
The webreport is triggered once a new business workspace is added to a folder, the triggerid is the value that is passed to the LiveReport which returns the dataid from teh llattradata based upon the query. The return value is used to create a parent relationship with the triggerid
The static way it works with hardcodes is because the transactions have already been committed to the database. When you work with triggers, this happens: the new node ID of the workspace will be attached to the reptag_triggerid (you should remember that this is happening in the server). When you see the output in HTML, the entire thing is probably done and printed by HTML. So you have to ask this, you have the parentid if the workspace where the trigger is enforced, so it will say node 1234567 was created. If your idea is to ask other tables, as Hans said, to find something else in the OTCS database, sure, theoretically it should work, but there could be system issues . Also, if there is a bulk process that creates about 500 workspaces per minute, and if they all do not work as intended, how does one ensure fidelity in it? So you could use a slightly slower paradigm. Here's an idea that would work.
Create a Form Template with SQL as its backing store
There should be a column to capture the trigger ID and a status. You can expand what is useful there later.
Your current WR that you use , make it write the triggerid node into that table and a status of new
End of the first WR.
Create another WR that reads the Form table and pulls a row of New
For each Row find the LLATTRDATA query and find the place where the related Bus Workspace needs to be attached
For each successful relation added , you could update the form table and put the Status as Done Error etc…
You can easily run rerun everything based on this table.
When you are satisfied you could just create this WR to run on a schedule.
PS:If you are pressed for time and dont have time to refactor, pursue what Hans said it should work
Hi,
I've skimmed all of this so apologies if I miss a point. The piece I can't see here is that you probably need two WebReports as you need some way to pass the trigger Id to the WebReport that has the Livereport as a data source. E.g.
TriggeredWebReport, calls a SubWebREport
The SubWebReport has your LiveReport as a datasource and is essentially the code you have above.
The Triggered WebReport should include code something like this:
[LL_REPTAG_$WKspCreationWR RUNSWR:sourceId:[LL_REPTAG_TRIGGERID /] /]
Obviously the constant points to your original WebReport.
A couple of other points. Initially you could just have your WebReport return the simple row section:
[LL_WEBREPORT_STARTROW /]
[LL_REPTAG=WpWorkspaceid /] [LL_WEBREPORT_ENDROW /]
just to confirm that you are getting the single Id as expected.
Also in your code you have:
[LL_REPTAG=WpWorkspaceid TRIM SHOW SETVAR:WPParentID /]
Minor point:
The SHOW sub-tag is unnecessary here. It is most effectively used when you want to set a variable, but you also want to show the value that was just put in the variable, e.g.
[LL_REPTAG=WpWorkspaceid TRIM SETVAR:WPParentID SHOW /]
Unless show is positioned after a variable setting (or CONCAT etc.) it doesn't do anything (though it will also not break anything).
I partly point this because I'm pedantic, but also if you're ever expecting an output through using SHOW it only works in the way I show above.