PageRenderTime 79ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 0ms

/Workflow/src/nodes/end.php

https://github.com/Yannix/zetacomponents
PHP | 85 lines | 12 code | 4 blank | 69 comment | 0 complexity | f1c5ee3ec1315a557ffc964a8f4743e2 MD5 | raw file
  1. <?php
  2. /**
  3. * File containing the ezcWorkflowNodeEnd class.
  4. *
  5. * Licensed to the Apache Software Foundation (ASF) under one
  6. * or more contributor license agreements. See the NOTICE file
  7. * distributed with this work for additional information
  8. * regarding copyright ownership. The ASF licenses this file
  9. * to you under the Apache License, Version 2.0 (the
  10. * "License"); you may not use this file except in compliance
  11. * with the License. You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing,
  16. * software distributed under the License is distributed on an
  17. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18. * KIND, either express or implied. See the License for the
  19. * specific language governing permissions and limitations
  20. * under the License.
  21. *
  22. * @package Workflow
  23. * @version //autogen//
  24. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25. */
  26. /**
  27. * An object of the ezcWorkflowNodeEnd class represents an end node of a workflow.
  28. *
  29. * A workflow must have at least one end node. The execution of the workflow ends
  30. * when an end node is reached.
  31. * Creating an object of the ezcWorkflow class automatically creates a default end node for the new
  32. * workflow. It can be accessed through the getEndNode() method.
  33. *
  34. * Incoming nodes: 1
  35. * Outgoing nodes: 0
  36. *
  37. * Example:
  38. * <code>
  39. * <?php
  40. * $workflow = new ezcWorkflow( 'Test' );
  41. * // build up your workflow here... result in $node
  42. * $node = ...
  43. * $workflow->startNode->addOutNode( ... some other node here ... );
  44. * $node->addOutNode( $workflow->endNode );
  45. * ?>
  46. * </code>
  47. *
  48. * @package Workflow
  49. * @version //autogen//
  50. */
  51. class ezcWorkflowNodeEnd extends ezcWorkflowNode
  52. {
  53. /**
  54. * Constraint: The minimum number of outgoing nodes this node has to have
  55. * to be valid.
  56. *
  57. * @var integer
  58. */
  59. protected $minOutNodes = 0;
  60. /**
  61. * Constraint: The maximum number of outgoing nodes this node has to have
  62. * to be valid.
  63. *
  64. * @var integer
  65. */
  66. protected $maxOutNodes = 0;
  67. /**
  68. * Ends the execution of this workflow.
  69. *
  70. * @param ezcWorkflowExecution $execution
  71. * @return boolean true when the node finished execution,
  72. * and false otherwise
  73. * @ignore
  74. */
  75. public function execute( ezcWorkflowExecution $execution )
  76. {
  77. $execution->end( $this );
  78. return parent::execute( $execution );
  79. }
  80. }
  81. ?>