Class: ProcessEngine::Schema::Node
- Inherits:
-
Object
- Object
- ProcessEngine::Schema::Node
- Defined in:
- app/models/process_engine/schema/node.rb
Defined Under Namespace
Modules: NodeType
Constant Summary collapse
- COMPUTED_NODE_TYPES =
[ NodeType::END_EVENT, NodeType::EXCLUSIVE_GATEWAY, NodeType::PARALLEL_BRANCHING, NodeType::SCRIPT_TASK ]
Instance Attribute Summary collapse
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#node_id ⇒ Object
readonly
Returns the value of attribute node_id.
-
#node_type ⇒ Object
readonly
Returns the value of attribute node_type.
-
#owners ⇒ Object
readonly
Returns the value of attribute owners.
-
#transitions ⇒ Object
readonly
Returns the value of attribute transitions.
Instance Method Summary collapse
-
#initialize(node_hash) ⇒ Node
constructor
A new instance of Node.
-
#next_nodes ⇒ Object
all linked next nodes without considerting node type.
- #next_schedulable_nodes(options = {}) ⇒ Object
- #node_extension ⇒ Object
Constructor Details
#initialize(node_hash) ⇒ Node
Returns a new instance of Node.
20 21 22 23 24 25 26 27 |
# File 'app/models/process_engine/schema/node.rb', line 20 def initialize(node_hash) @node_id = node_hash.fetch(:node_id) @node_type = node_hash.fetch(:node_type) @name = node_hash.fetch(:name) @owners = node_hash.fetch(:owners, []) @extension = node_hash.fetch(:extension, {}) @transitions = [] end |
Instance Attribute Details
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
18 19 20 |
# File 'app/models/process_engine/schema/node.rb', line 18 def extension @extension end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'app/models/process_engine/schema/node.rb', line 18 def name @name end |
#node_id ⇒ Object (readonly)
Returns the value of attribute node_id.
18 19 20 |
# File 'app/models/process_engine/schema/node.rb', line 18 def node_id @node_id end |
#node_type ⇒ Object (readonly)
Returns the value of attribute node_type.
18 19 20 |
# File 'app/models/process_engine/schema/node.rb', line 18 def node_type @node_type end |
#owners ⇒ Object (readonly)
Returns the value of attribute owners.
18 19 20 |
# File 'app/models/process_engine/schema/node.rb', line 18 def owners @owners end |
#transitions ⇒ Object (readonly)
Returns the value of attribute transitions.
18 19 20 |
# File 'app/models/process_engine/schema/node.rb', line 18 def transitions @transitions end |
Instance Method Details
#next_nodes ⇒ Object
all linked next nodes without considerting node type
30 31 32 |
# File 'app/models/process_engine/schema/node.rb', line 30 def next_nodes transitions.map(&:target) end |
#next_schedulable_nodes(options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'app/models/process_engine/schema/node.rb', line 34 def next_schedulable_nodes( = {}) nns = next_nodes if node_type == NodeType::EXCLUSIVE_GATEWAY ProcessEngine::Schema::Interceptor::ExclusiveGateway.execute(self, ) else nns end end |
#node_extension ⇒ Object
44 45 46 |
# File 'app/models/process_engine/schema/node.rb', line 44 def node_extension ProcessEngine::Schema::NodeExtension.new(self) end |