= sub { $args{$param}->TO_JSON; } };
eval { $params->{$param} = delete($args{$param})->TO_JSON; };
if($@) {
throw_param error => "Could not jsonize $param: $@";
sor role for ProcessInstance and ActivityInstance
use namespace::autoclean;
use Moose::Role;
use JSON;
use BPM::Engine::Util::ExpressionEvaluator;
use BPM::Engine::Exceptions qw/throw_store throw_par
lue));
$init->{ScriptType} ||= '';
if($init->{ScriptType} eq 'json') {
$ivalue = decode_json($ivalue);
}
else {
$ivalue = $expr->render($iv
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
__PACKAGE__->set_primary_key(qw/participant_id/);
__PACKAGE__->might_have(
serializer_class => 'JSON',
},
actual_params => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
da
serializer_class => 'JSON',
},
extended_attr => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
my $field = (keys %{$type})[0];
my ($multi, $single) = @{ $type->{$field} };
my $json = '';
#warn "Storing field $field multi $multi single $single type $type container $conta
{
$json = delete $args->{$multi};
my @event_types = keys %{$json};
next unless scalar @event_types;
$json = scalar @event_types ? $json->{$event_types[
&& $args->{$multi}->{$single}) {
$json = delete $args->{$multi}->{$single};
delete $args->{$multi};
next unless $json->[0];
# get rid of XML::LibXML::E
serializer_class => 'JSON',
},
extended_attr => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
__
d ASC' })->search(@args);
}
sub TO_JSON {
my $rs = shift;
my @instances = ();
while(my $row = $rs->next) {
my $instance = $row->TO_JSON;
$instance->{uri} = '/wfcs/acti
serializer_class => 'JSON',
},
data_fields => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
input_sets
serializer_class => 'JSON',
},
output_sets => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
assignm
serializer_class => 'JSON',
},
extended_attr => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
#size => 255,
is_nullable => 1,
serializer_class => 'JSON',
},
class => {
data_type => 'VARCHAR',
size
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
__PACKAGE__->set_primary_key(qw/ split_id /);
__PACKAGE__->belongs_to(
serializer_class => 'JSON',
},
artifacts => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
extended
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
);
__PACKAGE__->set_primary_key('package_id');
__PACKAGE__->uuid_columns('
);
#__PACKAGE__->many_to_many( package_transitions => 'processes', 'transitions' );
sub TO_JSON {
my $self = shift;
my %parms = map { $_ => $self->$_ } grep { $self->$_ }
qw/pa
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
is_readonly => {
data_type => 'BOOLEAN', # synonym for TINYINT(1
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
is_serializable => 1,
},
);
__PACKAGE__->set_primary_key(qw/ process_ins
serializer_class => 'JSON',
},
taskdata => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
taskresu
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
created => {
data_type => 'DATETIME',
is_nullable
b is_completed {
my $self = shift;
return $self->completed ? 1 : 0;
}
sub TO_JSON {
my ($self, $level) = @_;
my %struct = map { $_ => $self->$_ } grep { $self->$_ }
serializer_class => 'JSON',
},
formal_params => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
assignment
serializer_class => 'JSON',
},
extended_attr => {
data_type => 'TEXT',
is_nullable => 1,
serializer_class => 'JSON',
},
created =>
{process_name} ||= $attrs->{process_uid};
return $class->next::method($attrs);
}
sub TO_JSON {
my $self = shift;
my %params = map { $_ => $self->$_ } grep { $self->$_ }
qw/p
date({ workflow_instance_id => $rel->id });
$guard->commit;
return $self;
}
sub TO_JSON {
my $self = shift;
my $fields = {
map { $_ => $self->$_() }
qw/inst
ocess_id instance_name created completed/
};
# $fields->{attributes} = [ map { $_->TO_JSON } $self->attributes_rs->all ];
return $fields;
}
__PACKAGE__->meta->make_immutable( inli
$val = $self->next::method(@args);
return bless $val, 'BPM::Engine::DateTime';
}
sub TO_JSON {
my($self, $level) = @_;
my %parms = map { $_ => $self->$_ } grep { $self->$_ }
);
## no critic (ProhibitMultiplePackages)
{
package BPM::Engine::DateTime;
use strict;
use warnings;
use parent 'DateTime';
sub TO_JSON {
my $dt = shift;
return "$dt";
}
}
1;
__END__