From b476dcc1b0eb33ab7bd71eaa5da8ab7e1d9900be Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 10 Jun 2008 20:11:05 +0000 Subject: [PATCH] fixed a bug in the auto start realtime --- lib/WebGUI/Workflow/Instance.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Workflow/Instance.pm b/lib/WebGUI/Workflow/Instance.pm index be1cbf1da..b73337f61 100644 --- a/lib/WebGUI/Workflow/Instance.pm +++ b/lib/WebGUI/Workflow/Instance.pm @@ -71,7 +71,7 @@ sub create { # create instance my $instanceId = $session->db->setRow("WorkflowInstance","instanceId",{instanceId=>"new", runningSince=>time()}); - my $self = $class->new($session, $instanceId); + my $self = $class->new($session, $instanceId, 1); $self->set($properties,1); return $self; @@ -267,9 +267,17 @@ sub new { my $class = shift; my $session = shift; my $instanceId = shift; + my $isNew = shift; my $data = $session->db->getRow("WorkflowInstance","instanceId", $instanceId); return undef unless $data->{instanceId}; - bless {_session=>$session, _id=>$instanceId, _data=>$data, _started=>0}, $class; + my $self = { + _session => $session, + _id => $instanceId, + _data => $data, + _started => ($isNew ? 0 : 1) + }; + bless $self, $class; + return $self; } #-------------------------------------------------------------------