Giter Site home page Giter Site logo

bpm-online's Introduction

Http Terrasoft API

Description

The wrapper for use with API Terrasoft Link to the documentation on http

https://academy.terrasoft.ru/documents/technic-sdk/7-8-0/rabota-s-obektami-bpmonline-po-protokolu-odata-s-ispolzovaniem-http

The package uses the Laravel framework and its environment

If you find a bug or something else (and you always have) I ask you to contact me by mail [email protected]

Installation

composer require agoalofalife/bpm-online

To work correctly you need to write two providers if file app/config.php :

agoalofalife\bpmOnline\bpmOnlineServiceProvider::class
    agoalofalife\bpmOnline\bpmRegisterServiceProvider::class

And one facade :

CookieBpm' => agoalofalife\bpmOnline\Facade\Authentication::class

Configuration

You will need to set up your configuration file

 php artisan vendor:publish 

Bases request

Protocol On Date offers four types of request Select, Create, Delete and Update.

This package supports these features At the heart of any query is creating a base class

$api = new ApiBpm('Case', 'xml');

The first parameter is a collection if you do not know this term, read the documentation

The first parameter can be empty only if you want all collections

The second parameter specifies the format of the request, there are only two XML and Json

Select

Sample rich methods amount : If you want the request to return more than 40 records at a time, it can be implemented using the parameter $ top

skip    	  : In bpm'online support the use of parameter $ the skip , which allows you to query the service resources , skipping the specified number of entries.

orderby 	  : Service resources can be obtained in the form of sort.

filterConstructor : Request the type of filter,Design   filterConstructor allows you to build logical expressions the conditions selecting the desired object , Expressions filterConstructor can be used to reference the properties and literals , as well as strings, numbers and Boolean expressions (true, false). Expressions $ filter supports arithmetic , logical operations , and operations groups ,strings , date and time of the operation.

guid		  :  For a sample of a particular object on the guid

Here are some examples for a sample $api = new ApiBpm('Case', 'xml'); $api->select()->run();// method run necessarily

more complex structures..

     $api        = new ApiBpm('Case','json');
     $api->select()->guid('00000000-0000-0000-0000-000000000000')->run();


    $api         = new ApiBpm('Case','json');
    $api->select()->filterConstructor('Id eq guid\'00000000-0000-0000-0000-000000000000\'')->run();

    $api         = new ApiBpm('Case','json');
    $api->select()->orderby('Number','desc')->run();

    $api         = new ApiBpm('Case','json');
    $api->select()->skip(40)->amount(2)->orderby('Number','desc')->run();		

Create

  $api    = new ApiBpm('Case', 'xml'); 
  $result = $newCase->create()->run($data); // in method run pass an array

  $data   = [
    'CategoryId'   => '00000000-0000-0000-0000-000000000000',
    'StatusId'     => '00000000-0000-0000-0000-000000000000',
    'Subject'      => 'Hello',
    'Symptoms'     => 'Hello',
    "OriginId"     => "00000000-0000-0000-0000-000000000000",
    "ContactId"    => "00000000-0000-0000-0000-000000000000"
		   ];

Update

  $api    = new ApiBpm('Case', 'xml'); // or json
  $result = $newCase->update()->guid('00000000-0000-0000-0000-000000000000')->run($data);// in method run pass an array

Delete

Removal is quite simple

 $api    = new ApiBpm('Case', 'xml'); 
     $api->delete()->guid('00000000-0000-0000-0000-000000000000')->run();

Handler Responce

Each request code obrabavtyvaet answer in the form of easy to read, there are a few answers custom transformations

For XML : ->getData()

For JSON : ->toArray() ->json()

For All :
->CollectData()

for example..

   $api        = new ApiBpm('Case','xml');
       $result     = $api->select()->skip(40)->amount(2)->orderby('Number','desc')->run()->CollectData();
       
	or

  $result      = $api->select()->skip(40)->amount(2)->orderby('Number','desc')->run()->getData();

bpm-online's People

Contributors

agoalofalife avatar

Watchers

 avatar

Forkers

gor-eugene

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.