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)
checking the loc status before the workflow starts
amigo
I need to run the command iwattrib to check if the dcr associated with the workflow is locked or not....
If it is locked, an alert should be displayed to the user and the workflow "should not be instantiated"/ "should end if already instantiated".
I thought of calling an ipl to run the iwattrib command soon after the submit task, but the problem is that, since the file is locked, the workflow gets stuck...no 'active tasks' after submit task.....
I saw a post, 'validation before start of workflow' which is somewhat similar, but please let me know how to run the iwattrib command in the <template_script> tag and end the workflow.
Please help. Its a bit urgent.
Thanks a lot for any pointers in this regard.
Find more posts tagged with
Comments
debus
Can you use a <locktask> ? This task will activate if files have locks or not and you can then specify a <success> or <failure> transition. This method will avoid the workflow stalling. See the Workflow developers guide.
If using the iwattrib command within a workflow template (.wft) use the istagged attribute.
<template_script>
my $islocked = `iwattrib "/vpath/to/file" istagged`;
chomp $lock;
if ($islocked =~ /true/i)
{
# Setup a TAG_info field that will always fail validation so workflow cannot proceeed.
# You could add code to display error message to user.
}
Hope this helps.
</template_script>
Peter Debus
Principal Consultant / Solutions Architect
Formis
jbonifaci
My first question is, why do you care if the file is locked? I would assume most files a user would want to submit will be modified and locked. Or do you have a policy that they need to unlock the file before submitting? You do realize that submittasks have an option to unlock the file on submit, right? It sounds to me like that is all you are looking for.
But if you really want to check if any files are locked and prevent the instantiation, it's pretty straight forward. In your wft, you can do whatever kind of validation you want in perl before the workflow instantiates. Your wft is basically just a perl script, just get the file list the user selected and check if each one is locked. If any file attached is locked, just output an error message in your CGI_info->pre_tagtable_html. You'll also need to add a hidden field that has no value and is required. This will prevent the workflow from instantiating, as the field is required and will have no value and therefore can not be submitted.
~Jeff