PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/ezcomponents/Workflow/src/nodes/end.php

http://hppg.googlecode.com/
PHP | 69 lines | 12 code | 4 blank | 53 comment | 0 complexity | 3d4f678f28c494911653798b229d6714 MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause
  1. <?php
  2. /**
  3. * File containing the ezcWorkflowNodeEnd class.
  4. *
  5. * @package Workflow
  6. * @version 1.4.1
  7. * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved.
  8. * @license http://ez.no/licenses/new_bsd New BSD License
  9. */
  10. /**
  11. * An object of the ezcWorkflowNodeEnd class represents an end node of a workflow.
  12. *
  13. * A workflow must have at least one end node. The execution of the workflow ends
  14. * when an end node is reached.
  15. * Creating an object of the ezcWorkflow class automatically creates a default end node for the new
  16. * workflow. It can be accessed through the getEndNode() method.
  17. *
  18. * Incoming nodes: 1
  19. * Outgoing nodes: 0
  20. *
  21. * Example:
  22. * <code>
  23. * <?php
  24. * $workflow = new ezcWorkflow( 'Test' );
  25. * // build up your workflow here... result in $node
  26. * $node = ...
  27. * $workflow->startNode->addOutNode( ... some other node here ... );
  28. * $node->addOutNode( $workflow->endNode );
  29. * ?>
  30. * </code>
  31. *
  32. * @package Workflow
  33. * @version 1.4.1
  34. */
  35. class ezcWorkflowNodeEnd extends ezcWorkflowNode
  36. {
  37. /**
  38. * Constraint: The minimum number of outgoing nodes this node has to have
  39. * to be valid.
  40. *
  41. * @var integer
  42. */
  43. protected $minOutNodes = 0;
  44. /**
  45. * Constraint: The maximum number of outgoing nodes this node has to have
  46. * to be valid.
  47. *
  48. * @var integer
  49. */
  50. protected $maxOutNodes = 0;
  51. /**
  52. * Ends the execution of this workflow.
  53. *
  54. * @param ezcWorkflowExecution $execution
  55. * @return boolean true when the node finished execution,
  56. * and false otherwise
  57. * @ignore
  58. */
  59. public function execute( ezcWorkflowExecution $execution )
  60. {
  61. $execution->end( $this );
  62. return parent::execute( $execution );
  63. }
  64. }
  65. ?>