Activiti-Rest-Client

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        equal to rest call:
    
            POST query/executions

 signal_execution

        send signal to execution
    
        equal to rest call:
    
            PUT runtime/executions/{executionId}

 execution

      Get an execution
    
      Parameters:
    
        executionId
    
      equal to rest call:

README  view on Meta::CPAN

      Update a task
    
      Parameters:
    
        taskId
    
      Body parameters: see user guide (http://www.activiti.org/userguide/index.html#N148FA)
    
      equal to rest call:
    
        PUT runtime/tasks/:taskId

 task_variables

      Get all variables for a task
    
      Parameters:
    
        taskId
        scope (global|local)
    

lib/Activiti/Rest/Client.pm  view on Meta::CPAN

}
sub suspend_process_instance {
  my($self,%args)=@_;
  my $res = $self->ua->request(
    path => "/runtime/process-instances/".uri_escape($args{processInstanceId}),
    params => {},
    headers => {
      'Content-Type' => "application/json",
      Content => encode_json({ action => "suspend" })
    },
    method => "PUT"
  );
  Activiti::Rest::Response->from_http_response($res);
}
sub activate_process_instance {
  my($self,%args)=@_;
  my $res = $self->ua->request(
    path => "/runtime/process-instances/".uri_escape($args{processInstanceId}),
    params => {},
    headers => {
      'Content-Type' => "application/json",
      Content => encode_json({ action => "activate" })
    },
    method => "PUT"
  );
  Activiti::Rest::Response->from_http_response($res);
}

=head2 query_process_instances

  Query process instances

  Parameters: see user guide (http://www.activiti.org/userguide/index.html#N13E2A)

lib/Activiti/Rest/Client.pm  view on Meta::CPAN

    params => {},
    method => "GET"
  );
  Activiti::Rest::Response->from_http_response($res);
}
sub update_process_instance_variable {
  my($self,%args)=@_;
  my $res = $self->ua->request(
    path => "/runtime/process-instances/".uri_escape($args{processInstanceId})."/variables/".uri_escape($args{variableName}),
    params => {},
    method => "PUT",
    headers => {
      'Content-Type' => "application/json",
      Content => encode_json($args{content})
    }
  );
  Activiti::Rest::Response->from_http_response($res);
}
#DEPRECATED!
sub signal_process_instance {
  my($self,%args)=@_;

lib/Activiti/Rest/Client.pm  view on Meta::CPAN


    equal to rest call:

        POST query/executions
=cut
sub signal_execution {
  my($self,%args)=@_;
  my $res = $self->ua->request(
    path => "/runtime/executions/".uri_escape($args{executionId}),
    params => {},
    method => "PUT",
    headers => {
      'Content-Type' => "application/json",
      Content => encode_json($args{content})
    }
  );
  Activiti::Rest::Response->from_http_response($res);
}
=head2 signal_execution

    send signal to execution

    equal to rest call:

        PUT runtime/executions/{executionId}
=cut

=head2 execution

  Get an execution

  Parameters:

    executionId

lib/Activiti/Rest/Client.pm  view on Meta::CPAN

  Update a task

  Parameters:

    taskId

  Body parameters: see user guide (http://www.activiti.org/userguide/index.html#N148FA)

  equal to rest call:

    PUT runtime/tasks/:taskId

=cut

sub update_task {
  my($self,%args)=@_;
  my $res = $self->ua->request(
    path => "/runtime/tasks/".uri_escape($args{taskId}),
    params => {},
    method => "PUT",
    headers => {
      'Content-Type' => "application/json",
      Content => encode_json($args{content})
    }
  );
  Activiti::Rest::Response->from_http_response($res);
}
=head2 task_variables

  Get all variables for a task

lib/Activiti/Rest/Response.pm  view on Meta::CPAN

    #The operation is forbidden and should not be re-attempted. This does not imply an issue with authentication not authorization, it's an operation that is not allowed. Example: deleting a task that is part of a running process is not allowed and w...
    elsif($code eq "403"){
      Activiti::Rest::Error::Forbidden->throw($args);
    }

    #The operation failed.The requested resource was not found.
    elsif($code eq "404"){
      Activiti::Rest::Error::NotFound->throw($args);
    }

    #The operation failed. The used method is not allowed for this resource. Eg. trying to update (PUT) a deployment-resource will result in a 405 status.
    elsif($code eq "405"){
      Activiti::Rest::Error::MethodNotAllowed->throw($args);
    }

    #The operation failed. The operation causes an update of a resource that has been updated by another operation, which makes the update no longer valid. Can also indicate a resource that is being created in a collection where a resource with that ...
    elsif($code eq "409"){
      Activiti::Rest::Error::Conflict->throw($args);
    }

    #The operation failed. The request body contains an unsupported media type. Also occurs when the request-body JSON contains an unknown attribute or value that doesn't have the right format/type to be accepted.

lib/Activiti/Rest/UserAgent/LWP.pm  view on Meta::CPAN

  my $path = $args{path} || "";
  my $headers = $args{headers};

  my $url = $self->url().$path;

  my $res;
  if(uc($method) eq "GET"){
    $res = $self->_get($url,$params,$headers);
  }elsif(uc($method) eq "POST"){
    $res = $self->_post($url,$params,$headers);
  }elsif(uc($method) eq "PUT"){
    $res = $self->_put($url,$params,$headers);
  }elsif(uc($method) eq "DELETE"){
    $res = $self->_delete($url,$params,$headers);
  }else{
    confess "method $method not supported";
  }

  $res;
}
sub _post {



( run in 0.587 second using v1.01-cache-2.11-cpan-4e96b696675 )