Download the PHP package tyhand/workflow-bundle without Composer

On this page you can find all versions of the php package tyhand/workflow-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package workflow-bundle

Workflow Bundle

Build Status codecov.io Code Climate

A simple experimental Symfony bundle built to help manage some of our application workflows. Don't know if I like the end result, but here it is.

Requirements

Symfony 2.3 or higher and Doctrine 2.2 or higher.

Installation

To install with composer, add the bundle to your composer json.

Next register the bundle with the AppKernel.

Usage

Making a workflow instance

To make an entity be able to be used as a workflow instance, you need to implement the context interface in the entity class.

After that the methods in the interface will need to be implemented, or you can add the TyHand\WorkflowBundle\Workflow\Context\ContextTrait trait to the entity to implement all the methods in the interface. With the interface added and the methods implemented or the trait added, run the doctrine schema commands to add the workflow tables. Dumping the SQL should show tables for the workflow context and many-to-many tables for each entity that implements the context interface.

Once the dumped SQL is verified, update the schema either through a forced update or a database migration.

Creating a workflow

Start a new workflow by creating a new workflow definition class that extends the abstract workflow definition provided by the bundle.

The abstract workflow definition has three methods that are abstract that will need to be implemented. First is getName() which just returns a name for the workflow. This name should be unique in the scope of the application. The second method is getContextClass() which returns the name of the class that is the context of the workflow.

The third required method is the build method which is the meat of the workflow definition. This method will receive and return a workflow builder that specifies the structure of the workflow.

The main part of the workflow are the states. States each have a unique name (in the scope of the workflow), a set of exit conditions, and an optional set of actions. If a state has no exit conditions then it is considered a terminal state, and once a workflow instance reaches this point, it is no longer considered active. Actions are methods that can be called when an instance enters a workflow. The exit conditions can either be an event that can be fired elsewhere in the application, a conditional statement that is evaluated upon an instance entering the state, and a time limit that moves to a given state if an instance has been in the state for so long. Note: to use the time limit condition, a cron job or something similar will need to run the app/console check time limit command ('tyhand_workflow:states:check_time_limit') at set intervals or your choosing.

Example:

To make state actions and conditions more useful, just inject various services into the workflow definition and add them to the conditions or action function. For example, let's say we want to throw an event at the end of the workflow, then just add an action kind of like this to your terminal state.

Make a the workflow manager aware of the definition class by making it a service and adding the 'tyhand_workflow.definition' tag. Example:

Placing instance into a workflow

Put a context into a workflow by using the workflow manager service.

Workflow events

Trigger the event transtions by throwing a workflow event with context, workflow name, and event name.

Testing

PHPUnit is used for testing the bundle. Create a phpunit.xml from the phpunit.xml.dist file located in the root of the bundle, and then run phpunit to test.

License

This bundle is under the MIT License


All versions of workflow-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version >=2.3.0
doctrine/orm Version >=2.2.3
doctrine/doctrine-bundle Version 1.2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tyhand/workflow-bundle contains the following files

Loading the files please wait ....