lib/core/core_setup_init.rb
# Function to build a step/order structure of Attributes.
# step/order is an array of array.
# the first array represents the steps
# the second array represents the list of attributes in a specific order.
#
# This structure is used by setup to ask the list of attributes in a
# specific order.
#
# It loops on object dependencies, then data definition to determine the
# list of attributes and their required order.
#
# A new step is created when an attribute, during setup time requires
# to query an object, which may requires some additional attributes,
# considered as dependent attributes.
# The previous step must contains at least the dependent attributes.
#
# Process data definition can influence those detected steps, by assigning
# an :ask_step to the attribute.
# Then the default attribute step may be splitted to more steps.
#
# You cannot set an attribute step lower then the detected step.
# Process data definition can influence the attributes order, by assigning
# an :ask_order to the attribute.
#
# :setup section of the process data definition (data.yaml) can set the step
# description or add some extra attributes (not detected by default)
#
# * *Args* :
#   - sObjectType : Symbol/String. Object type to analyze for list of
#     attributes to setup
#   - setup_steps : Hash. setup data structure to update.
#                   It will update setup_steps:/:order 2 dimensions array
#
# * *Returns*:
#   - setup_steps: Hash updated
#
# * *Raises* :
#
Function to build a step/order structure of Attributes.
step/order is an array of array.
the first array represents the steps
the second array represents the list of attributes in a specific order.

This structure is used by setup to ask the list of attributes in a
specific order.

It loops on object dependencies, then data definition to determine the
list of attributes and their required order.

A new step is created when an attribute, during setup time requires
to query an object, which may requires some additional attributes,
considered as dependent attributes.
The previous step must contains at least the dependent attributes.

Process data definition can influence those detected steps, by assigning
an :ask_step to the attribute.
Then the default attribute step may be splitted to more steps.

You cannot set an attribute step lower then the detected step.
Process data definition can influence the attributes order, by assigning
an :ask_order to the attribute.

:setup section of the process data definition (data.yaml) can set the step
description or add some extra attributes (not detected by default)

*Args* :
sObjectType : Symbol/String. Object type to analyze for list of
attributes to setup
setup_steps : Hash. setup data structure to update.
It will update setup_steps:/:order 2 dimensions array

*Returns*:
setup_steps: Hash updated

*Raises* .
Function to build a step / order structure of Attributes . step / order is an array of array . the first array represents the steps the second array represents the list of attributes in a specific order . This structure is used by setup to ask the list of attributes in a specific order . It loops on object dependencies then data definition to determine the list of attributes and their required order . A new step is created when an attribute during setup time requires to query an object which may requires some additional attributes considered as dependent attributes . The previous step must contains at least the dependent attributes . Process data definition can influence those detected steps by assigning an : ask_step to the attribute . Then the default attribute step may be splitted to more steps . You cannot set an attribute step lower then the detected step . Process data definition can influence the attributes order by assigning an : ask_order to the attribute . : setup section of the process data definition ( data . yaml ) can set the step description or add some extra attributes ( not detected by default ) * Args * : sObjectType : Symbol / String . Object type to analyze for list of attributes to setup setup_steps : Hash . setup data structure to update . It will update setup_steps : / : order 2 dimensions array * Returns * : setup_steps : Hash updated * Raises * .
def _setup_identify(sObjectType, setup_steps)
      dependencies = { :objects => {}, :attributes => {} }
      _setup_identify_dep_init(dependencies, sObjectType)
      Lorj.debug(2, '- Checking objects dependencies -')
      _setup_identify_deps(dependencies, sObjectType)
      Lorj.debug(2, '- Checking attributes dependencies -')
      orders = _setup_build_steps_from(dependencies)
      Lorj.debug(2, '- Re-organizing attributes steps/order -')
      attrs = _setup_reorganize_steps_order(dependencies[:attributes], orders)
      Lorj.debug(2, '- Add extra steps -')
      _setup_reorganize_steps(attrs, orders, setup_steps)
    end
def _setup_identify ( sObjectType , setup_steps ) dependencies = { :objects => { } , :attributes => { } } _setup_identify_dep_init ( dependencies , sObjectType ) Lorj . debug ( 2 , '- Checking objects dependencies -' ) _setup_identify_deps ( dependencies , sObjectType ) Lorj . debug ( 2 , '- Checking attributes dependencies -' ) orders = _setup_build_steps_from ( dependencies ) Lorj . debug ( 2 , '- Re-organizing attributes steps/order -' ) attrs = _setup_reorganize_steps_order ( dependencies [ :attributes ] , orders ) Lorj . debug ( 2 , '- Add extra steps -' ) _setup_reorganize_steps ( attrs , orders , setup_steps ) end
Function to build a step/order structure of Attributes.
Function to build a step / order structure of Attributes .
# There is 3 sources of data used by setup to build the list of data to # setup: # - Lorj.data (Lorj::MetaConfig): Process data definition. # - config (Lorj::Account)      : Configuration files/runtime data. # - PrcLib.model.meta_obj(Hash) : Object definition / mapping # Build list of attributes which will be needed for an object and # its dependencies # Build list of additional attributes and build # attribute dependencies thanks to attribute queries. # Reorganize each required steps thanks to :ask_order # Apply additionnal steps as described by Lorj.data
sObjectType
<not_specific>
setup_steps
<not_specific>