PHPackages                             raoul2000/yii-simple-workflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. raoul2000/yii-simple-workflow

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

raoul2000/yii-simple-workflow
=============================

A simple workflow engine for Yii 1

1.0.9(11y ago)278.2k16[2 PRs](https://github.com/raoul2000/simpleWorkflow/pulls)BSD-3-ClauseHTMLPHP &gt;=5.1.0CI failing

Since May 21Pushed 5y ago3 watchersCompare

[ Source](https://github.com/raoul2000/simpleWorkflow)[ Packagist](https://packagist.org/packages/raoul2000/yii-simple-workflow)[ Docs](http://s172418307.onlinehome.fr/project/sandbox/www/index.php?r=simpleWorkflow/page&view=home)[ RSS](/packages/raoul2000-yii-simple-workflow/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![simpleWorkflow](https://camo.githubusercontent.com/c0506158ae1f9de8dcdf9647ad3555c2ed9d40e5d5a7e4a7d02f02c8817a4370/687474703a2f2f733137323431383330372e6f6e6c696e65686f6d652e66722f70726f6a6563742f79696944656d6f2f696d616765732f73772d6c6f676f2d6269672e706e67)](https://camo.githubusercontent.com/c0506158ae1f9de8dcdf9647ad3555c2ed9d40e5d5a7e4a7d02f02c8817a4370/687474703a2f2f733137323431383330372e6f6e6c696e65686f6d652e66722f70726f6a6563742f79696944656d6f2f696d616765732f73772d6c6f676f2d6269672e706e67)

The **simpleWorkflow** extension is a set of Yii components that is dedicated to provide an easy way to manage the life cycle of CActiveRecord objects inside a workflow. It provides features to control the behavior of the active record in its associated workflow : transition tasks, status constraints, event model.

> Note that the *simpleWorklfow* extension, following Yii 1.1 life cycle, has also reached end of life. Please consider using [yii2-workflow](https://github.com/raoul2000/yii2-workflow) extension with Yii 2.x

### Resources

[](#resources)

- [Usage Guide](./doc/DOCUMENTATION.md)
- [API documentation](http://s172418307.onlinehome.fr/project/sandbox/www/resources/simpleWorkflow/api/index.html)
- [Join discussion](http://www.yiiframework.com/forum/index.php?/topic/12071-extension-simpleworkflow/)

Documentation
-------------

[](#documentation)

### Requirements

[](#requirements)

- Yii 1.1.4 or above

### Installation

[](#installation)

- Extract the released files under `protected/extensions`.
- add the SWPhpWorkflowSource component to your configuration

```
'components'=>array(
	// adding the simple Workflow source component
	'swSource'=> array(
		'class'=>'application.extensions.simpleWorkflow.SWPhpWorkflowSource',
	), ...
```

- add simpleWorkflow extension base folder to your imports

```
'import'=>array(
	...
	'application.extensions.simpleWorkflow.*',	// Import simpleWorkflow extension
),
```

### Usage

[](#usage)

Once installed and correctly configured, the simpleWorkflow extension will handle the workflow for any model. To enable simpleWorkflow for a given model, you must attach the `SWActiveRecordBehavior` behavior to this model.

```
class MyModel extends CActiveRecord {
	public function behaviors()
	{
		return array(
			'swBehavior' => array(
				'class' => 'application.extensions.simpleWorkflow.SWActiveRecordBehavior'
			)
		);
	}
}
```

The model can then be inserted into a workflow, and evolve among statuses inside this workflow. For instance, the code below insert an existing record into a workflow, or if already done, displays its current status :

```
$m=MyModel::model()->findByPk('1');
if( $m->swHasStatus() ){
     echo 'status : '.$m->swGetStatus()->toString();
}else {
     $m->swInsertToWorkflow();
     $m->save();
}
```

For more information on how to use the simpleWorkflow extension, please refer to the [full documentation](http://s172418307.onlinehome.fr/project/yiiDemo/index.php?r=simpleworkflowdemo/index)

### Gii Command

[](#gii-command)

Creating a workflow 'by hand' can become an error-prone task when several nodes and edges are required. One good option is to create the workflow using a **visual tools**, and after some searches it seems that one of the best application to do it is [yEd Graph Editor](http://www.yworks.com/en/products_yed_about.html). Of course, it is free to use !

Want to know more ? [Read how to use the GII command](./doc/GII-COMMAND.md) to create your workflow...

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4015d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec7e087ebb28d42d781766dce67eb6d8911a11a5e3dd7e793800f506d17f0a00?d=identicon)[raoul2000](/maintainers/raoul2000)

---

Top Contributors

[![raoul2000](https://avatars.githubusercontent.com/u/1474310?v=4)](https://github.com/raoul2000 "raoul2000 (14 commits)")

---

Tags

modelworkflowyiilife cycle

### Embed Badge

![Health badge](/badges/raoul2000-yii-simple-workflow/health.svg)

```
[![Health](https://phpackages.com/badges/raoul2000-yii-simple-workflow/health.svg)](https://phpackages.com/packages/raoul2000-yii-simple-workflow)
```

###  Alternatives

[symfony/workflow

Provides tools for managing a workflow or finite state machine

62942.3M170](/packages/symfony-workflow)[romka-chev/yii2-swiper

Yii2 extension for Swiper slider

1840.6k](/packages/romka-chev-yii2-swiper)[romdim/yii2-bootstrap-material

Composer package for implementing FezVrasta's bootstrap material design in Yii2.

2010.9k3](/packages/romdim-yii2-bootstrap-material)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
