added a mechanism to workflows so that they can be run serially rather than parallel

This commit is contained in:
JT Smith 2006-02-13 16:59:29 +00:00
parent f9a60ab55a
commit 3d92467451
3 changed files with 14 additions and 1 deletions

View file

@ -288,6 +288,10 @@ A boolean indicating whether this workflow may be executed right now.
A string indicating the type of object this workflow will be operating on. Valid values are "none", "versiontag" and "user".
=head4 isSerial
A boolean indicating whether this workflow can be run in parallel or serial. If it's serial, then only one instance of the workflow will be allowed to be created at a given time. So if you try to create a new instance of it, and one instance is already created, the create() method will return undef instead of a reference to the object.
=cut
sub set {
@ -298,6 +302,11 @@ sub set {
} elsif ($properties->{enabled} == 0) {
$self->{_data}{enabled} = 0;
}
if ($properties->{isSerial} == 1) {
$self->{_data}{isSerial} = 1;
} elsif ($properties->{isSerial} == 0) {
$self->{_data}{isSerial} = 0;
}
$self->{_data}{title} = $properties->{title} || $self->{_data}{title} || "Untitled";
$self->{_data}{description} = (exists $properties->{description}) ? $properties->{description} : $self->{_data}{description};
$self->{_data}{type} = $properties->{type} || $self->{_data}{type} || "none";