2017 © Pedro Peláez
 

library workflow

The Workflow package for manage state and transition

image

bantenprov/workflow

The Workflow package for manage state and transition

  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 5 Versions
  • 21 % Grown

The README.md

Join the chat at https://gitter.im/bantenprov-workflow/Lobby Scrutinizer Code Quality Build Status, (*1)

Workflow Management

Workflow management for easily manage states and transitions in a complex business prosess., (*2)

The final of this package will be contained some awesome feature:, (*3)

  • Workflow
  • Workflow State
  • Workflow Transition
  • Workflow Notification
  • Workflow Guard
  • Transition Attachment
  • Attachment
  • Notification To
  • Notification cc
  • History

Workflow Management

Join the chat at https://gitter.im/bantenprov-workflow/Lobby Workflow management for easily manage states and transitions in a complex business prosess., (*4)

Scrutinizer Code Quality Build Status, (*5)

The final of this package will be contained some awesome feature:, (*6)

Worklow

  • Define a name and descriotion of the workflow, each conte type could containt more then one workflow to manage their business process

State

  • Define a collection of state name in worflow related, and describe the latest status the content in a business process

Transition

  • Define a transition of any state in content, this feature will be handle move transition

Guard

  • Guard give a permission to manage one or any authorization of the role management to the transition related

Notification

  • When a state of content was change, or a transition executed a notification will be sent by system to pic related. notification displayed in user desktop related and as mail notification.

TODO

See TODO before use this., (*7)

DEMO

Demo site for this packages is available here : Workflow., (*8)

Install Laravel :

$ composer create-project --prefer-dist laravel/laravel project-name "5.4.*"

Install package :

$ composer require bantenprov/workflow "1.0.0"

Edit config/config.php

Edit config/app.php

providers

'providers' => [
    ...
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    ...
    Collective\Html\HtmlServiceProvider::class,
    'That0n3guy\Transliteration\TransliterationServiceProvider',
    Bantenprov\Workflow\WorkflowServiceProvider::class,

aliases

'aliases' => [
    ...
    'Storage' => Illuminate\Support\Facades\Storage::class,
    'URL' => Illuminate\Support\Facades\URL::class,
    'Validator' => Illuminate\Support\Facades\Validator::class,
    'View' => Illuminate\Support\Facades\View::class,
    ...
    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
    'Workflow' => Bantenprov\Workflow\Facades\Workflow::class,

Artisan command :

$ php artisan vendor:publish --tag=workflow_migrations
$ php artisan vendor:publish --tag=workflow_views
$ php artisan vendor:publish --tag=workflow_css
$ php artisan vendor:publish --tag=workflow_js
$ php artisan migrate

Contoh penggunaan :

Trait :

1. WorkflowStateTrait

use Bantenprov\Workflow\Traits\WorkflowStateTrait;

class WorkflowStateController extends Controller
{
    use WorkflowStateTrait;

    public function index()
    {
        return WorkflowStateTrait::stateIndex();
    }
}

2. WorkflowTransitionTrait

use Bantenprov\Workflow\Traits\WorkflowTransitionTrait;

class WorkflowTransitionController extends Controller
{
    use WorkflowTransitionTrait;

    public function index()
    {
        return WorkflowStateTrait::transitionIndex();
    }
}

WorkflowStateTrait sample

#
Method NULL Default Ex Type
1 stateIndex($page = 10) Y 10 $page=10 Integer
2 stateCreate() Y - - -
3 stateStore($request,= array()) N - $request->all() Array
4 stateEdit($id) N -
$id = 1
Integer
5 stateUpdate($request= array(), $id) N -
$request->all()
$id = 1
Array
6 stateActive($id) N - $id = 1
Integer
7 stateDeActive($id) N - $id = 1
Integer

WorkflowTransitionTrait sample

#
Method NULL Default Ex Type
1 transitionIndex($page = 10) Y 10 $page=10 Integer
2 transitionCreate() Y - - -
3 transitionStore($request = array()) N - $request->all() Array
4 transitionEdit($id) N -
$id = 1
Integer
5 transitionUpdate($request = array(), $id) N -
$request->all()
$id = 1
Array
6 transitionActive($id) N - $id = 1
Integer
7 transitionDeActive($id) N - $id = 1
Integer

Contoh 2

pada aplikasi yang digunakan, (*9)

//Controller
use Bantenprov\Workflow\Workflow
...
public function SOMETHING()
{
    $id = 1;
    return \Workflow::getStateName($id);
}

//Controller
use Bantenprov\Workflow\Workflow
...
public function SOMETHING()
{
    $id = 1;
    return \Workflow::getTransitionName($id);
}

CSS

folder style.css : public/css/style.css, (*10)


<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">        
        <title>Laravel</title>

        <!-- Fonts -->
  -->   <link href="{{ asset('css/workflow_style.css') }}" rel="stylesheet" type="text/css">

JS

folder custom.js : public/js/custom.js, (*11)



            </div>
        </div>
  -->   
    </body>
</html>

The Versions

02/01 2018

dev-dev

dev-dev https://github.com/bantenprov/workflow

The Workflow package for manage state and transition

  Sources   Download

MIT

The Requires

 

16/12 2017

dev-master

9999999-dev https://github.com/bantenprov/workflow

The Workflow package for manage state and transition

  Sources   Download

MIT

The Requires

 

16/12 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/bantenprov/workflow

The Workflow package for manage state and transition

  Sources   Download

MIT

The Requires

 

16/12 2017

1.0.1

1.0.1.0 https://github.com/bantenprov/workflow

The Workflow package for manage state and transition

  Sources   Download

MIT

The Requires

 

23/11 2017

1.0.0

1.0.0.0 https://github.com/bantenprov/workflow

The Workflow package for manage state and transition

  Sources   Download

MIT

The Requires