Loading...
Flash Player 9 (or above) is needed to view slideshows. We have detected that you do not have it on your computer.To install it, go here
A Workflow Engine for PHP 5
Workflow Management (WfM) is becoming more and more important. For the development and maintainance of software that supports workflows, a new layer on top of the base programming language is needed. Graph-Oriented Programming (GOP) is such a layer. This session presents the eZ Components' workflow engine, its possible applications and the underlying principles and techniques.
4895 views | comments | 5 favorites | 0 downloads | 18 embeds (Stats)
More Info
This slideshow is Public
Total Views: 4895 on Slideshare: 3263 from embeds: 1632
Most viewed embeds (Top 5):
More
Slideshow Transcript
- Slide 1: ezcWorkflow
A Workflow Engine for PHP 5
Sebastian Bergmann
http://sebastian-bergmann.de/
- Slide 2: Who I Am
• Sebastian Bergmann
• Computer Scientist
• Involved in the
PHP Project since 2000
• Author, Consultant,
Coach, Trainer
• Developer for
eZ Systems AS
Sebastian Bergmann: A Workflow Engine for PHP 5 2
- Slide 3: Who are you?
• Your experience with
PHP 5?
●
OOP?
●
eZ Components?
●
Workflow?
●
Sebastian Bergmann: A Workflow Engine for PHP 5 3
- Slide 4: Introduction
Business enterprises need to reduce the cost
●
of doing business and continually develop new
services and products.
• Enterprise Content Management
– helps with storing business-critical content
(customer data, documents, etc.) in a central
repository and in a unified way.
• Workflow Management
– provides the methodologies and software that
help with organizing the processes that operate
on this content inside an organization.
Sebastian Bergmann: A Workflow Engine for PHP 5 4
- Slide 5: What is Workflow Management?
“The automation of a business process, in
●
whole or parts, where documents, information
or tasks are passed from one participant to
another to be processed, according to a set of
procedural rules” [RA01]
Sebastian Bergmann: A Workflow Engine for PHP 5 5
- Slide 6: What is Workflow Management?
“Technology supporting the reengineering of
●
business and information processes. It
involves: (1) defining workflows, i.e.,
describing those aspects of a process that are
relevant to controlling and coordinating the
execution of its tasks [...], and (2) providing
for fast (re)design and (re)implementation of
the processes as business needs and
information systems change” [DG95]
Sebastian Bergmann: A Workflow Engine for PHP 5 6
- Slide 7: Motivation
The Workflow of eZ Publish 3
Sebastian Bergmann: A Workflow Engine for PHP 5 7
- Slide 8: Activity-Based Workflow Mgmt.
Who must do what when and how?
Sebastian Bergmann: A Workflow Engine for PHP 5 8
- Slide 9: Activity-Based Workflow Mgmt.
Who must do what when and how?
• Directed Graph
– Nodes represent activity steps
– Edges between nodes represent the flow
• Control Flow
• Data Flow
– Nodes can have service objects attached to
them
Sebastian Bergmann: A Workflow Engine for PHP 5 9
- Slide 10: Workflow Patterns
• W.M.P. van der Aalst, A.H.M. ter Hofstede,
B. Kiepuszewski, and A.P. Barros. Workflow
Patterns.
• Requirements for Workflow Languages
• Vocabulary to compare Workflow Languages
Sebastian Bergmann: A Workflow Engine for PHP 5 10
- Slide 11: Workflow Patterns
• Basic Control Flow Patterns
– Sequence, Parallel Split (AND-Split),
Synchronization (AND-Join), Exclusive Choice
(XOR-Split), Simple Merge (XOR-Join)
• Advanded Branching and Synchronization
– Multi-Choice (OR-Split), Synchronizing Merge
(OR-Join), Multi-Merge, Discriminator
• Structure
– Arbitrary Cycles, Cancel Case, Implicit
Termination
Sebastian Bergmann: A Workflow Engine for PHP 5 11
- Slide 12: Graph-Oriented Programming
• Implementation technique for graph-based
execution languages
• Strategy for implementing graph execution on
top of an object-oriented programming
language
• Original implementation: JBoss jBPM
Sebastian Bergmann: A Workflow Engine for PHP 5 12
- Slide 13: Graph-Oriented Programming
• Provides the means to structure software
around graphs
• Adds wait states to object-oriented
programming language
– Ability to suspend and resume executions
Sebastian Bergmann: A Workflow Engine for PHP 5 13
- Slide 14: Graph-Oriented Programming
Sebastian Bergmann: A Workflow Engine for PHP 5 14
- Slide 15: Graph-Oriented Programming
Sebastian Bergmann: A Workflow Engine for PHP 5 15
- Slide 16: Graph-Oriented Programming
Sebastian Bergmann: A Workflow Engine for PHP 5 16
- Slide 17: Workflow Virtual Machine
• Sérgio Miguel Fernandes, João Cachopo, and
António Rito Silva. Supporting Evolution in
Workflow Design Languages.
• Isolate the core of the Workflow Management
System from the Workflow Description
Language
– No standard Workflow Description Language
– Workflow Description Languages change
• Compile frontend Workflow Description
Language(s) to backend representation
Sebastian Bergmann: A Workflow Engine for PHP 5 17
- Slide 18: Micro-Workflow Architecture
• Dragos A. Manolescu. An Extensible Workflow
Architecture with Objects and Patterns.
• Object-Oriented
– Original implementation in Smalltalk
• Component-Oriented
– Separation of concerns
– Components are exchangeable
Sebastian Bergmann: A Workflow Engine for PHP 5 18
- Slide 19: Micro-Workflow Architecture
• Components
– Core
• Execution
• Process
• Synchronization
• Persistence
• Worklist
• Manual Intervention
• History
• Monitoring
• Federated Workflow
Sebastian Bergmann: A Workflow Engine for PHP 5 19
- Slide 20: ezcWorkflow
• Reusable workflow engine component
• Part of the eZ Components
– Version 1.0 released on July 2nd 2007
• Developed as part of my Diploma Thesis
Sebastian Bergmann: A Workflow Engine for PHP 5 20
- Slide 21: Interlude: eZ Components
• Provide a solid platform for PHP application
development
• Clean and simple API
• Excellent documentation
• Keep backward compatibility for longer periods
of time
• Stable and few regressions
• Clean IP, Open Source friendly
Sebastian Bergmann: A Workflow Engine for PHP 5 21
- Slide 22: Interlude: eZ Components
• pear channel-discover components.ez.no
• pear install ezc/ezcomponents
<?php
require 'ezc/Base/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
Sebastian Bergmann: A Workflow Engine for PHP 5 22
- Slide 23: ezcWorkflow
• Pragmatic approach to describe workflows
through objects that encapsulate the workflow
patterns
• A workflow definition is an object graph than
can be
– programmatically created using the
Workflow Definition API or
– loaded from an XML file
– and executed via the Workflow Execution API
Sebastian Bergmann: A Workflow Engine for PHP 5 23
- Slide 24: ezcWorkflow
GUI XML Mail / SOAP / ...
Wf Definition API Wf Execution API
Workflow Core
Data Storage
Sebastian Bergmann: A Workflow Engine for PHP 5 24
- Slide 25: ezcWorkflow
• Workflow Definition API
– Exposes functionality to create, modify, and
delete workflow definitions
• Workflow Execution API
– Exposes functionality to start, suspend, resume,
and stop workflow execution
– Exposes functionality to monitor workflow
execution
Sebastian Bergmann: A Workflow Engine for PHP 5 25
- Slide 26: ezcWorkflow
Example: Defining a workflow programmatically
$workflow = new ezcWorkflow( 'Test' );
$input = new ezcWorkflowNodeInput(
array(
'choice' => new ezcWorkflowConditionIsBool
)
);
$workflow->startNode->addOutNode( $input );
Sebastian Bergmann: A Workflow Engine for PHP 5 26
- Slide 27: ezcWorkflow
Example: Defining a workflow programmatically
$branch = new ezcWorkflowNodeExclusiveChoice;
$branch->addInNode( $input );
$branch->addConditionalOutNode(
new ezcWorkflowConditionVariable(
'choice',
new ezcWorkflowConditionIsTrue
),
new ezcWorkflowNodeAction( 'PrintTrue' )
);
// ...
Sebastian Bergmann: A Workflow Engine for PHP 5 27
- Slide 28: ezcWorkflow
Example: Defining a workflow programmatically
$merge = new ezcWorkflowNodeSimpleMerge;
$merge->addInNode( $true )
->addInNode( $false )
->addOutNode( $workflow->endNode );
Sebastian Bergmann: A Workflow Engine for PHP 5 28
- Slide 29: ezcWorkflow
Example: Saving a workflow definition to XML
$merge = new ezcWorkflowNodeSimpleMerge;
$merge->addInNode( $true )
->addInNode( $false )
->addOutNode( $workflow->endNode );
$storage = new ezcWorkflowDefinitionStorageXml(
'/path/to/xml/files'
);
$storage->save( $workflow );
Sebastian Bergmann: A Workflow Engine for PHP 5 29
- Slide 30: ezcWorkflow
Example: Saving a workflow definition to XML
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<workflow name=\"Test\" version=\"1\">
<node id=\"1\" type=\"Start\">
<outNode id=\"2\"/>
</node>
<node id=\"2\" type=\"Input\">
<variable name=\"choice\">
<condition type=\"IsBool\"/>
</variable>
<outNode id=\"3\"/>
</node>
<node id=\"3\" type=\"ExclusiveChoice\">
<condition type=\"Variable\" name=\"choice\">
<condition type=\"IsTrue\"/>
<outNode id=\"4\"/>
</condition>
<condition type=\"Variable\" name=\"choice\">
<condition type=\"IsFalse\"/>
<outNode id=\"5\"/>
</condition>
</node>
<node id=\"4\" type=\"Action\" serviceObjectClass=\"PrintTrue\">
<outNode id=\"6\"/>
</node>
<node id=\"5\" type=\"Action\" serviceObjectClass=\"PrintFalse\">
<outNode id=\"6\"/>
</node>
<node id=\"6\" type=\"SimpleMerge\">
<outNode id=\"7\"/>
</node>
<node id=\"7\" type=\"End\"/>
</workflow>
Sebastian Bergmann: A Workflow Engine for PHP 5 30
- Slide 31: ezcWorkflow
Example: Saving a workflow definition to a database
$merge = new ezcWorkflowNodeSimpleMerge;
$merge->addInNode( $true )
->addInNode( $false )
->addOutNode( $workflow->endNode );
$storage = new ezcWorkflowDatabaseDefinitionStorage(
ezcDbFactory::create( $dsn )
);
$storage->save( $workflow );
Sebastian Bergmann: A Workflow Engine for PHP 5 31
- Slide 32: ezcWorkflow
Example: Executing a workflow
$execution = new ezcWorkflowDatabaseExecution(
$db
);
$execution->setWorkflow( $workflow );
$executionId = $execution->start();
// ...
$execution->resume(
$executionId,
array( 'choice' => true )
);
Sebastian Bergmann: A Workflow Engine for PHP 5 32
- Slide 33: ezcWorkflow
Example: Testing a workflow
$execution = new ezcWorkflowTestExecution;
$execution->setWorkflow( $workflow );
$execution->setInputVariable( 'choice', true );
$execution->start();
Sebastian Bergmann: A Workflow Engine for PHP 5 33
- Slide 34: ezcWorkflow
Early Adopters
• OXID eSales GmbH has adopted ezcWorkflow
– Thomas Nunninger (of OXID eSales GmbH) has
developed a persistence backend for Zend_Db
• Dave Heath has developed a persistence
backend for Doctrine
– He is also working on an AJAXy workflow editor
Sebastian Bergmann: A Workflow Engine for PHP 5 34
- Slide 35: The End
• Thank you for your interest!
• These slides will be available shortly on
http://sebastian-bergmann.de/talks/
Sebastian Bergmann: A Workflow Engine for PHP 5 35
- Slide 36: License
• This presentation material is published under the Creative Commons Attribution-
NonCommercial-NoDerivs 3.0 Unported license.
• You are free:
– to Share – to copy, distribute and transmit the work.
• Under the following conditions:
– Attribution. You must attribute the work in the manner specified by the
author or licensor (but not in any way that suggests that they endorse you or
your use of the work).
– Noncommercial. You may not use this work for commercial purposes.
– No Derivative Works. You may not alter, transform, or build upon this work.
• For any reuse or distribution, you must make clear to others the license terms of
this work. The best way to do this is with a link to this web page.
• Any of the above conditions can be waived if you get permission from the
copyright holder.
• Nothing in this license impairs or restricts the author's moral rights.
Sebastian Bergmann: Qualitätssicherung in PHP-Projekten 36