use proper JSON encoding/decoding

This commit is contained in:
Graham Knop 2009-02-10 21:41:36 +00:00
parent 7023683b48
commit bf9bd2f0d2
18 changed files with 54 additions and 54 deletions

View file

@ -66,7 +66,7 @@ sub create {
my ($isSingleton) = $session->db->quickArray("select count(*) from Workflow where workflowId=? and mode='singleton'",$placeHolders);
my $sql = "select count(*) from WorkflowInstance where workflowId=?";
if (exists $properties->{parameters}) {
push @{ $placeHolders }, JSON->new->utf8->canonical->encode({parameters => $properties->{parameters}});
push @{ $placeHolders }, JSON->new->canonical->encode({parameters => $properties->{parameters}});
$sql .= ' and parameters=?';
}
else {
@ -466,7 +466,7 @@ sub set {
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
if (exists $properties->{parameters}) {
$self->{_data}{parameters} = JSON->new->utf8->canonical->encode({parameters => $properties->{parameters}});
$self->{_data}{parameters} = JSON->new->canonical->encode({parameters => $properties->{parameters}});
}
$self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId};
$self->session->db->setRow("WorkflowInstance","instanceId",$self->{_data});