encode parameter JSON with canonical so that it is consistent
This commit is contained in:
parent
1db1e783fb
commit
57029b2a65
1 changed files with 3 additions and 3 deletions
|
|
@ -65,7 +65,7 @@ sub create {
|
||||||
my ($isSingleton) = $session->db->quickArray("select count(*) from Workflow where workflowId=? and mode='singleton'",$placeHolders);
|
my ($isSingleton) = $session->db->quickArray("select count(*) from Workflow where workflowId=? and mode='singleton'",$placeHolders);
|
||||||
my $sql = "select count(*) from WorkflowInstance where workflowId=?";
|
my $sql = "select count(*) from WorkflowInstance where workflowId=?";
|
||||||
if (exists $properties->{parameters}) {
|
if (exists $properties->{parameters}) {
|
||||||
push @{ $placeHolders }, JSON->new->utf8->pretty->encode({parameters => $properties->{parameters}});
|
push @{ $placeHolders }, JSON->new->utf8->canonical->encode({parameters => $properties->{parameters}});
|
||||||
$sql .= ' and parameters=?';
|
$sql .= ' and parameters=?';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -445,16 +445,16 @@ A boolean, that if set to 1 will not inform Spectre of the change in settings.
|
||||||
|
|
||||||
sub set {
|
sub set {
|
||||||
my ($self, $properties, $skipNotify) = @_;
|
my ($self, $properties, $skipNotify) = @_;
|
||||||
|
$self->{_data}{lastUpdate} = time();
|
||||||
$self->{_data}{priority} = $properties->{priority} || $self->{_data}{priority} || 2;
|
$self->{_data}{priority} = $properties->{priority} || $self->{_data}{priority} || 2;
|
||||||
$self->{_data}{lastStatus} = $properties->{lastStatus} || $self->{_data}{lastStatus};
|
$self->{_data}{lastStatus} = $properties->{lastStatus} || $self->{_data}{lastStatus};
|
||||||
$self->{_data}{workflowId} = $properties->{workflowId} || $self->{_data}{workflowId};
|
$self->{_data}{workflowId} = $properties->{workflowId} || $self->{_data}{workflowId};
|
||||||
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
|
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
|
||||||
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
|
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
|
||||||
if (exists $properties->{parameters}) {
|
if (exists $properties->{parameters}) {
|
||||||
$self->{_data}{parameters} = JSON->new->utf8->pretty->encode({parameters => $properties->{parameters}});
|
$self->{_data}{parameters} = JSON->new->utf8->canonical->encode({parameters => $properties->{parameters}});
|
||||||
}
|
}
|
||||||
$self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId};
|
$self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId};
|
||||||
$self->{_data}{lastUpdate} = time();
|
|
||||||
$self->session->db->setRow("WorkflowInstance","instanceId",$self->{_data});
|
$self->session->db->setRow("WorkflowInstance","instanceId",$self->{_data});
|
||||||
if ($self->{_started} && !$skipNotify) {
|
if ($self->{_started} && !$skipNotify) {
|
||||||
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue