Graph-Oriented Programming with PHP

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    Theme created by Sakari Koivunen and Henrik Omma Released under the LGPL license.

    5 Favorites

    Graph-Oriented Programming with PHP - Presentation Transcript

    1. Welcome!
        • A Workflow Engine for PHP 5
        • or: Graph-Oriented Programming with PHP
        • Sebastian Bergmann
        • http://sebastian-bergmann.de/
        • May 22 nd 2007
    2. Who I Am
      • Sebastian Bergmann
      • Contributor to the PHP Project since 2000
      • Creator of PHPUnit
      • Author, Consultant, Trainer
      • Developer for eZ Systems AS
    3. Who Are You?
      • Your Background
        • PHP 5?
        • OOP?
        • Workflow?
    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.
    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]
    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]
    7. Motivation The workflow of eZ Publish 3
    8. Activity-Based Workflow Mgmt. Who must do what when and how ?
    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
    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
    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 Join, Multi-Merge, Discriminator
      • Structure
        • Arbitrary Cycles, Implicit Termination
    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
    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
    14. Graph-Oriented Programming
    15. Graph-Oriented Programming
    16. Graph-Oriented Programming
    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
    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
    19. Micro-Workflow Architecture
      • Components
        • Core
          • Execution
          • Process
          • Synchronization
      • Persistence
      • Worklist
      • Manual Intervention
      • History
      • Monitoring
      • Federated Workflow
    20. ezcWorkflow
      • Reusable workflow engine component
      • Part of the eZ Components
      • Developed as part of my Diploma Thesis
      • Version 1.0 will be released at the end of this month
    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
    22. Interlude: eZ Components <?php require 'ezc/Base/base.php' ; function __autoload ( $className ) { ezcBase :: autoload ( $className ); }
      • pear channel-discover components.ez.no
      • pear install ezc/ezcomponents
    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
    24. ezcWorkflow Data Storage Workflow Core Wf Definition API Wf Execution API GUI XML Mail / SOAP / ...
    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
    26. ezcWorkflow $workflow = new ezcWorkflow ( 'Test' ); $start = $workflow -> getStartNode (); $end = $workflow -> getEndNode (); $input = new ezcWorkflowNodeInput ( array( 'choice' => new ezcWorkflowConditionIsBool ) ); $start -> addOutNode ( $input ); Example: Defining a workflow
    27. ezcWorkflow $branch = new ezcWorkflowNodeExclusiveChoice ; $branch -> addInNode ( $input ); $branch -> addConditionalOutNode ( new ezcWorkflowConditionVariable ( 'choice' , new ezcWorkflowConditionIsTrue ), new ezcWorkflowNodeAction ( 'PrintTrue' ) ); // ... Example: Defining a workflow
    28. ezcWorkflow $merge = new ezcWorkflowNodeSimpleMerge ; $merge -> addInNode ( $true ) -> addInNode ( $false ) -> addOutNode ( $end ); Example: Defining a workflow
    29. ezcWorkflow $merge = new ezcWorkflowNodeSimpleMerge ; $merge -> addInNode ( $true ) -> addInNode ( $false ) -> addOutNode ( $end ); $definition = new ezcWorkflowDefinitionXml ( '/path/to/xml/files' ); $definition -> save ( $workflow ); Example: Saving a workflow to XML
    30. ezcWorkflow <?xml version = &quot;1.0&quot; encoding = &quot;UTF-8&quot; ?> <workflow name = &quot;Test&quot; version = &quot;1&quot; > <node id = &quot;1&quot; type = &quot;Start&quot; > <outNode id = &quot;3&quot; /> </node> <node id = &quot;2&quot; type = &quot;End&quot; /> <node id = &quot;3&quot; type = &quot;Input&quot; > <variable name = &quot;choice&quot; > <condition type = &quot;IsBool&quot; /> </variable> <outNode id = &quot;4&quot; /> </node> <node id = &quot;4&quot; type = &quot;ExclusiveChoice&quot; > <condition type = &quot;Variable&quot; name = &quot;choice&quot; > <condition type = &quot;IsTrue&quot; /> <outNode id = &quot;5&quot; /> </condition> <condition type = &quot;Variable&quot; name = &quot;choice&quot; > <condition type = &quot;IsFalse&quot; /> <outNode id = &quot;6&quot; /> </condition> </node> <node id = &quot;5&quot; type = &quot;Action&quot; serviceObjectClass = &quot;PrintTrue&quot; > <outNode id = &quot;7&quot; /> </node> <node id = &quot;6&quot; type = &quot;Action&quot; serviceObjectClass = &quot;PrintFalse&quot; > <outNode id = &quot;7&quot; /> </node> <node id = &quot;7&quot; type = &quot;SimpleMerge&quot; > <outNode id = &quot;2&quot; /> </node> </workflow> Example: Saving a workflow to XML
    31. ezcWorkflow $merge = new ezcWorkflowNodeSimpleMerge ; $merge -> addInNode ( $true ) -> addInNode ( $false ) -> addOutNode ( $end ); $definition = new ezcWorkflowDatabaseDefinition ( ezcDbFactory :: create ( $dsn ) ); $definition -> save ( $workflow ); Example: Saving a workflow to a database
    32. ezcWorkflow $execution = new ezcWorkflowDatabaseExecution ( $db ); $execution -> setWorkflow ( $workflow ); $executionId = $execution -> start (); // ... $execution -> resume ( $executionId , array( 'choice' => true ) ); Example: Executing a workflow
    33. ezcWorkflow $execution = new ezcWorkflowTestExecution ; $execution -> setWorkflow ( $workflow ); $execution -> setInputVariable ( 'choice' , true ); $execution -> start (); Example: Testing a workflow
    34. The End
      • Thank you for your interest!
      • These slides will be available shortly on http://sebastian-bergmann.de/talks/.
    35. Bibliography
      • Rob Allen. Workflow: An Introduction . In: Workflow Handbook, Workflow Management Coalition, 2001.
      • Dimitrios Georgakopoulos and Mark F. Hornick and Amit P. Sheth. An Overview of Workflow Management: From Process Modeling to Workflow Automation Infrastructure . In: Distributed and Parallel Databases, Volume 3, Number 2, Pages 119-153, 1995.
    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 BergmannSebastian Bergmann, 3 years ago

    custom

    4572 views, 5 favs, 1 embeds more stats

    More info about this document

    CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

    Go to text version

    • Total Views 4572
      • 4564 on SlideShare
      • 8 from embeds
    • Comments 0
    • Favorites 5
    • Downloads 0
    Most viewed embeds
    • 8 views on http://sebastian-bergmann.de

    more

    All embeds
    • 8 views on http://sebastian-bergmann.de

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories