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)
workflow locking and unlocking
sma
I have a workflow which generate a HTML from a DCR. Then HTML is attached to the workflow but not the DCR. When workflow starts, it locks the HTML file. However, the DCR is locked by templating. The problem is that when another person tries to submit the same DCR (locked) to another workflow, Teamsite allows it. However, when it's trying to generate the HTML from the second workflow, it failed because the DCR is locked. I need to prevent the second user to kick off another workflow from the same DCR. Any suggestions?
Find more posts tagged with
Comments
johnjamesmarsh
When the workflow is started run a check to see if the files that are added are locked by the current user. If they are not either don't add them to the workflow or report an error and terminate the workflow.
I modifed the default_submit.wft to do something similar.
for (my $i=0; $i<
@submit_file
; ++$i)
{
my $lockusername = `$iwhome/bin/iwattrib $iw_workarea/$submit_file[$i] lastuser`;
chomp($lockusername);
$fileListOut = $fileListOut . $submit_file[$i];
$lockUsernameOut = $lockUsernameOut . "$lockusername";
if ($lockusername eq $user) {
if ($fileAddedCount == 1)
{
TAG_info(
file_cmts_replicate_hdr =>
[ html => "</tr>",
is_required => 'false',
label => "</tr><tr><td colspan=2><INPUT TYPE='button' VALUE='Replicate Comment' onClick='copy_file_comment(self);'></tr><tr>"
],
);
}
TAG_info(
"File_comment_$fileAddedCount" =>
[ html => "</td></tr><tr><td colspan=2>" .
"$submit_file[$i]<br>" .
"<div class='fontmain'><textarea rows=3 cols=50></textarea></div>",
error_msg => 'Please enter a comment.',
is_required => 'true',
label => "</td></tr><tr>",
],
);
$fileAddedCount ++;
}
}
if ($fileAddedCount == 0) {
#add the noFiles so that we can put some javascript in to close the submit if the initial conditions are not met
my $noFiles=<<EOS;
<script language="javascript">
alert("There are no files marked as locked by you. No files can be submitted from this area.");
self.close()
</script>
<table border='0' width='100%' cellspacing=0 cellpadding=0
bgcolor='white'>
<tr width='100%'>
<td><h1><center>theAA.com</center></h1></td>
</tr>
</table>
EOS
TAG_info(
"File_names" =>
[ html => "$noFiles",
label => "There are no files to be submitted",
is_required => 'true',
],
);
}
Hope that helps,
John
sma
Thanks.....I will look into it.