Home
TeamSite
Kick off workflow on dcr save
brendang
Hi,
How do people kick off a workflow on saving a dcr. We're using TS6. In the past we had a trigger iwatcreate, but are tyring not to use that. I use the following for generating my xml files onsave and would like to do something similar for workflow.
function runGenerate()
{
var params = new Object();
var server = window.location.hostname;
var dcrpath = getDCRPath();
params.dcrpath = dcrpath;
var server = window.location.hostname;
var url = "http://"+server+"/iw-bin/iw_cgi_wrapper.cgi/ad_common_on_dcr_save.ipl";
IWDatacapture.callServer(url, params, true);
// alert(" Path is " + dcrpath + " \nCalling the following cgi: " + url);
return(true);
}
/*
Initializes the script to use the onSaveDone handling functionality
*/
IWEventRegistry.addFormHandler("onSaveDone", saveDone)
Thanks
Find more posts tagged with
Comments
iwovGraduate
Have you considered using <command value='tt_data' /> in available_templates.cfg for your workflow ? It will start the workflow when you hit "Close" or "Save & Close" button.
brendang
HI,
I thought that only happened if you started a job and attached the file you're working on?
Thanks
brendang
HI,
Another problem with using the tt_data tag is that in Content Center Professional this is not fired on closing the dcr. Aparently it is in Standard, but my users want to use Professional :-(
Thanks
ts_user
What about running the iwwft_compile.ipl to invoke a workflow from your call server script in addition to generating your xml files. I think this requires you to be on TS SP3 +
Thanks,
~tu
brendang
HI,
In the end this is how I've done it:
function checkSubmit() {
var server = window.location.hostname;
var dcrpath = getDCRPath();
var server = window.location.hostname;
var rtn = confirm("Would you like to submit your work?");
if (rtn == true) {
var url = "http://" + server + "/iw-cc/submit?vpath=" + dcrpath;
open(url, null, 'toolbar=0, location=0, directories=0, status=1, menubar=0, copyhistory=0,width=640,height=600');
}
return true;
}
the key thing is you can invoke the 'submit' by using a URL command.
What do people think?
Thanks
Adam Stoller
Can you explain [again?] why you cannot just use the existing tt_data mechanism in available_templates.cfg ?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
brendang
Because in Content Center Professional tt_data doesn't cause workflow to be invoked when saving a dcr. Basically the way our content entry has been working is this:
1. user creates or edits existing dcr
2. user hits save
3. user is prompted with "Do you want to submit to staging?"
4. users hits ok -> system invokes workflow appropriate for user and dct
Alternate
4. user hits cancel -> no workflow invoked.
With TS 5.5 this used to happen, but with TS 6, this is not happening and I'm trying to emulate that functionallity.
Thank you for your help!
iwovGraduate
There are atleast a copule of threads on this tt_data not supported in CCPro - the explanation given by some IWOVers about why its not supported is just not convincing enough.
Anyway, can anybody confirm that this is a feature request and if its planned to be fixed in any upcoming releases/patches ?
brendang
I could not agree more. What's even more infuriating is that for standard it DOES work!
Migrateduser
I also agree. I think there's a FR regarding this issue. Anyone have the #? If it's not a FR, it should be and we should all sign up for it. This is probably the biggest thing keeping me from telling our users that CCPro is an option as an alternative UI.
- Jason
Gregg Faus
Yes it is definately a pain to log into CCSTD as an author just to kick off a workflow for a DCR. I filed this as a feature request some time in January 2004 (tracked as FR #50623).
I also found it a pain to see the wizard functionality for submit option, meta tagging (disabled via tookit), and feedback steps. So I hacked the code a bit to disable this steps so that the tt_data task is kicked off when you click the "Next" button in a DCR. It then closes the form when everything is done submitting.
PJoneja
Yes it is definately a pain to log into CCSTD as an author just to kick off a workflow for a DCR. I filed this as a feature request some time in January 2004 (tracked as FR #50623).
Actually, I believe that it is FR [bold]#50621[/bold], which is being fixed in TS 6.1 SP1. The feature will be turned off by default, but the customization guide will include instructions on how to turn it on.
-Pam
Gregg Faus
Yeah you're right. It is FR #50621. FR #50623 was my request to configure a done_page after the workflow wizard is complete.
dlukezic
Hi there! I was hoping you could help me with something... I noticed that you have a method in your function called getDCRPath. Is this a custom method? I haven't been able to use it, but I am in need of it.
If you wouldn't mind sharing it...
Thanks!
Doreen
brendang
Hi Doreen,
Yes, it's a custom method, so probably not supported (so use at your own risk :-). Here it is and another one you might be interested in:
//====================================================================
// Returns the vpath of the dcr
//====================================================================
function getDCRPath() {
return ( parent.datacapture.getDCRVPath() );
}
//====================================================================
// Returns the workarea this dcr is in
//====================================================================
function getWorkarea() {
return( top._dcWin.gWorkarea );
}
HTH
Brendan
dlukezic
Thanks for the quick reply!
Is there something else I have to add in order to be able to use parent.datacapture.getDCRVPath()? I am getting a JavaScript error stating that parent.datacapture.getDCRVPath is not a function.
Thanks!
Doreen
brendang
Hi Doreen,
There is nothing I needed to add. Basically I have this at the top of each of my dcts:
<script language="javascript" src="
http://<your
servername here>/iw/js/on_save_done_callout.js" />
In my on_save_done_callout.js file I have the function I sent you and at the bottom I register a function that is called when I save as shown:
//====================================================================
// Registers an event to generate xml files on save
//====================================================================
IWEventRegistry.addFormHandler("onSaveDone", saveDone);
This function ultimately calls the getDCRVPath() fucntion when the user saves the dcr.
HTH
dlukezic
Still not working for me. Does anyone have any ideas about my error message?
Thanks,
Doreen
Migrateduser
Sorry, I haven't been following this thread. What error message?
I am not sure you want to use that variable to get the DCR name - the function getWorkarea is probably OK (though it should be in a shared .js file, not a DCT-specific .js file, since IW may change the implementation at any time), but isn't the DCR name available from IWDCRInfo.getDCRName()? Not sure if that also has the subdirectory if the DCR is not in the root data folder.
Migrateduser
> the key thing is you can invoke the 'submit' by using a URL command
seems dangerous - does this run as the browser user or under some system account?
dlukezic
Hi! The error is: a JavaScript error stating that parent.datacapture.getDCRVPath is not a function.
IWDCRInfo.getDCRName() does not return the path. Only the name.
Do you know another way to get the path where the DCR is saved?
Thanks,
Doreen
brendang
It's documented how to do it in the "Interwoven user interface customization guide" about page 80. I am wrapping the call using:
/iw-bin/iw_cgi_wrapper.cgi
which is supposed to run the command as the user themselves I believe.
Migrateduser
I'm sorry I don't, but it must be available somewhere. I think somewhere in my code I must have assumed that that function returns the data-relative path...
When I have to hack it I usually use
http://www.iconico.com/webtool/index.aspx
. It takes some work but you may eventually find the variable or function. Of course since it's not documented it can change with patch/release, so put the code in a shared .js module.
If you can file a case with support and/or come up with a solution, please indicate it here.
Migrateduser
Interesting, I thought we were moving away from CGI and Java would manage the authentication.
You might want kill your cookie and see what happens if you invoke the URL. Does it provide a UI?