Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Setting Variable
mk2004
Hi,
Does anyone have an idea on how to setting a workflow variable when a dcr is saved.
Find more posts tagged with
Comments
Adam Stoller
Please try to elaborate on your question.
Setting workflow variables from within a workflow context is trivial within externaltask and cgitask scripts
Setting workflow variables from outside a workflow context is not too difficult if you already know the workflow context.
Detecting when a DCR is saved is tricky - unless you are handling it with FormAPI - in which case you'd probably need to use the CallServer() function to call a CGI on the TeamSite server to perform the actual workflow variable setting - but I'm not sure how you'd get the workflow context unless the DCR is already attached to the workflow.
The more details you can provide about the scenario your are trying to deal with - the better chance we have of providing more realistic solutions.
Also - please include information about the version of TeamSite you are using and the platform of the TeamSite server system.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
mk2004
My first task in the workflow is generating a blank dcr then the next is the user task where i want to set the varialbe. I am using the callserver() function on DCR save to call a cgi but unable to catch the task or job ID.
thx!
mk2004
My TS version is 5.5.2 on Solaris box
Migrateduser
Use the CLT iwgetfilejobs.
Adam Stoller
What is the purpose of this job variable?
What are the constraints you wish to place on this variable being set?
Does it have to be done via the DCR or would using an externaltask after the usertask where the DCR is edited be okay?
As I said - the more details you provide about what you are trying to do - the better chance we can guide you to a solution. Using FormAPI's CallServer() is only one possible way to accomplish what you've indicated so far, and it's not necessarily the best (largely because of CallServer being asynchronous, but also because you would need to invoke a process in the called CGI in order to determine the taskid associated with the DCR ....)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
mk2004
This variable is set to the headline field of the template(file) and shown as a link to the user to open the file.
Right now the link is shown with a standard name for a newly created file but is updated to the headline when the job transition to next task as i am setting the variable in the workflow. But this updation of the variable should be done once the file is saved.
Adam Stoller
I'm still a little confused about *where* this variable is being used/rendered as a link for the user to open the file ... is that happening within the context of the workflow or something that's used by the PT to render something in the generated output from the DCR?
Assuming the former - are you talking about a cgitask script that presents a link for the user to click on? If so - that cgitask script could fairly easily parse the attached DCR itself to get that information (TeamSite::XMLnode or TeamSite:
CRnode) without needing to use job variables at all.
If you still want a job variable set - you can still make use of the aforementioned modules within either a cgitask or externaltask script to retrieve the information from the attached DCR and set the job variable within the current workflow. It may mean one additional task inserted between when the user edits the DCR and whatever was intended to come after it - but I think it would be cleaner and easier to maintain than trying to do it via a CallServer() FormAPI call within the DCT itself.
The FormAPI approach would involve having to call a CGI [or JSP?] on the TeamSite server - asynchronously - and that program would have to invoke one CLT to figure out what job the DCR is attached to - in order to invoke another CLT to set the job variable. Remember that this is all asynchronous so you'd either have to build in the logic to wait for the CGI to complete the onSave event in the DCT or hope you don't run into a race-issue with regard to when you're setting and later accessing this job variable.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com