Download the PHP package onlab/balno-workflow without Composer

On this page you can find all versions of the php package onlab/balno-workflow. 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 balno-workflow

BalnoWorkflow

Build Status

BalnoWorkflow is a workflow engine built for PHP 5.5+ based on some other Workflows and State Machines that does not have all features in the same lib.

This workflow gives to you the following feature:

Workflow Events to Subscribe

You can check the events available in the interface WorkflowEvents:

Basic Definition Sample

Always the first state defined will be set as initial state in the case below, the 'state_1' state is set as initial state.

Given a new Context to execute...

... this workflow will execute the below history:

trigger begin_execution listeners

IMPORTANT: initial state will not trigger onEntry actions

... check for default (no event set) transitions (found transition without guard to state_2)

trigger begin_transition listeners

execute state_1 onExit actions

trigger state_changed listeners

execute state_2 onEntry actions

trigger end_transition listeners

... check for default transitions (found one with guard)

execute guard balno.workflow.guard.timer:hasTimedOut("30m") that returns false

trigger end_execution listeners

Now the state is in a paused state. To move forward the workflow must be executed after 30m (to satisfy the configured guard timeout) or be executed with an event some_event.

To trigger the event you must run the code below (imagine that you is resuming the workflow with a persisted context):

.. or if you just want to resume the workflow to reach the timeout condition:

Actions

Every action or guard are executed by the workflow passing the Context object as first parameter followed by the parameters configured on the action or guard.

Given a guard guard.example:someGuardCondition("test1", 2) the method must be something like this:

Parallel Execution

Parallel execution is a special state that can't forward to an other state (even by an event) until all parallel workflows are finished.

From the [Basic Definition Sample]:

Since PHP unfortunately does not work with threads out-of-the-box the BalnoWorkflow will execute first the forked_workflow1 then forked_workflow2. So I recommend to place the fast process first then the slowest.

But imagine you need to send an e-mail to your client to confirm his e-mail (you're using a slow SMTP server) on the forked_workflow2 and the forked_workflow1 will prepare an order to the product factory. Sending an e-mail to the client will be better than creating an order to the factory. So, in this case, to satisfy the customer, will be better to execute the slowest workflow first.

If you really need to execute in parallel you may setup a initial state without a default transition to pause one or both workflows then run each workflow in kind of worker.

IMPORTANT: the workflow will automatically try to resume the parent context when you resume a child workflow and it finishes. So, if you're really trying to parallelize this sub workflows ensure that your locking system is compatible with this scenario.


All versions of balno-workflow with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
symfony/event-dispatcher Version ^2.6
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 onlab/balno-workflow contains the following files

Loading the files please wait ....