it lives!!!!
This commit is contained in:
parent
00644808a1
commit
8950b951bc
4 changed files with 72 additions and 10 deletions
|
|
@ -27,9 +27,55 @@ addEMSTemplates();
|
||||||
addEMSTables();
|
addEMSTables();
|
||||||
updateTemplates();
|
updateTemplates();
|
||||||
updateDatabaseLinksAndSQLReport();
|
updateDatabaseLinksAndSQLReport();
|
||||||
|
addWorkflow();
|
||||||
|
|
||||||
finish($session); # this line required
|
finish($session); # this line required
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub addWorkflow {
|
||||||
|
print "\tAdding workflow.\n";
|
||||||
|
$session->db->write("create table WorkflowSchedule (
|
||||||
|
taskId varchar(22) binary not null primary key,
|
||||||
|
enabled int not null default 1,
|
||||||
|
minuteofHour varchar(25) not null default '0',
|
||||||
|
hourOfDay varchar(25) not null default '*',
|
||||||
|
dayOfMonth varchar(25) not null default '*',
|
||||||
|
monthOfYear varchar(25) not null default '*',
|
||||||
|
dayOfWeek varchar(25) not null default '*',
|
||||||
|
workflowId varchar(22) binary not null
|
||||||
|
)");
|
||||||
|
$session->db->write("create table WorkflowInstance (
|
||||||
|
instanceId varchar(22) binary not null primary key,
|
||||||
|
workflowId varchar(22) binary not null,
|
||||||
|
currentActivityId varchar(22) binary not null,
|
||||||
|
priority int not null default 2,
|
||||||
|
className varchar(255),
|
||||||
|
methodName varchar(255),
|
||||||
|
parameters text,
|
||||||
|
runningSince bigint
|
||||||
|
)");
|
||||||
|
$session->db->write("create table Workflow (
|
||||||
|
workflowId varchar(22) binary not null primary key,
|
||||||
|
title varchar(255) not null default 'Untitled',
|
||||||
|
description text
|
||||||
|
)");
|
||||||
|
$session->db->write("create table WorkflowActivity (
|
||||||
|
activityId varchar(22) binary not null primary key,
|
||||||
|
workflowId varchar(22) binary not null,
|
||||||
|
title varchar(255) not null default 'Untitled',
|
||||||
|
description text,
|
||||||
|
previousActivityId varchar(22) binary not null,
|
||||||
|
dateCreated bigint,
|
||||||
|
className varchar(255)
|
||||||
|
)");
|
||||||
|
$session->db->write("create table WorkflowActivityProperty (
|
||||||
|
propertyId varchar(22) binary not null primary key,
|
||||||
|
activityId varchar(22) binary not null,
|
||||||
|
name varchar(255),
|
||||||
|
value text
|
||||||
|
)");
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
sub updateDatabaseLinksAndSQLReport {
|
sub updateDatabaseLinksAndSQLReport {
|
||||||
print "\tUpdating the Database link and SQLReport Tables.\n";
|
print "\tUpdating the Database link and SQLReport Tables.\n";
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,8 @@ Returns an integer representing the number of running jobs.
|
||||||
|
|
||||||
sub countRunningJobs {
|
sub countRunningJobs {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return scalar(@{$self->{_runningJobs}});
|
my $runningJobs = $self->{_runningJobs} || [];
|
||||||
|
return scalar(@{$runningJobs});
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -186,16 +186,20 @@ sub new {
|
||||||
return $config{$filename};
|
return $config{$filename};
|
||||||
} else {
|
} else {
|
||||||
my $json = "";
|
my $json = "";
|
||||||
open(FILE,"<".$webguiPath.'/etc/'.$filename);
|
if (open(FILE,"<".$webguiPath.'/etc/'.$filename)) {
|
||||||
while (my $line = <FILE>) {
|
while (my $line = <FILE>) {
|
||||||
$json .= $line unless ($line =~ /^\s*#/);
|
$json .= $line unless ($line =~ /^\s*#/);
|
||||||
|
}
|
||||||
|
close(FILE);
|
||||||
|
my $conf = jsonToObj($json);
|
||||||
|
my $self = {_webguiRoot=>$webguiPath, _configFile=>$filename, _config=>$conf};
|
||||||
|
bless $self, $class;
|
||||||
|
$config{$filename} = $self unless $noCache;
|
||||||
|
return $self;
|
||||||
|
} else {
|
||||||
|
warn "Cannot open config file: ".$filename;
|
||||||
|
return undef;
|
||||||
}
|
}
|
||||||
close(FILE);
|
|
||||||
my $conf = jsonToObj($json);
|
|
||||||
my $self = {_webguiRoot=>$webguiPath, _configFile=>$filename, _config=>$conf};
|
|
||||||
bless $self, $class;
|
|
||||||
$config{$filename} = $self unless $noCache;
|
|
||||||
return $self;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,17 @@ STOP
|
||||||
}
|
}
|
||||||
|
|
||||||
my $config = WebGUI::Config->new("..","spectre.conf",1);
|
my $config = WebGUI::Config->new("..","spectre.conf",1);
|
||||||
|
unless (defined $config) {
|
||||||
|
print <<STOP;
|
||||||
|
|
||||||
|
|
||||||
|
Cannot open the Spectre config file. Check that ../etc/spectre.conf exists,
|
||||||
|
and that it has the proper privileges to be read by the Spectre server.
|
||||||
|
|
||||||
|
|
||||||
|
STOP
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($shutdown) {
|
if ($shutdown) {
|
||||||
my $remote = create_ikc_client(
|
my $remote = create_ikc_client(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue