services:
    oro_action.condition_locator:
        class: Symfony\Component\DependencyInjection\ServiceLocator
        public: false
        arguments:
            - [] # conditions
        tags:
            - { name: container.service_locator }

    oro_action.expression.extension:
        class: 'Oro\Component\ConfigExpression\Extension\DependencyInjection\DependencyInjectionExtension'
        arguments:
            - '@oro_action.condition_locator'
            - {}

    oro_action.expression.context_accessor:
        class: 'Oro\Component\ConfigExpression\ContextAccessor'

    oro_action.expression.factory:
        class: 'Oro\Component\ConfigExpression\ExpressionFactory'
        arguments:
            - '@oro_action.expression.context_accessor'
        calls:
            - [addExtension, ['@oro_action.expression.extension']]

    oro_action.expression.assembler:
        class: 'Oro\Component\ConfigExpression\ExpressionAssembler'
        arguments:
            - '@oro_action.expression.factory'
        calls:
            - [addConfigurationPass, ['@oro_action.configuration_pass.replace_property_path']]

    oro_action.condition.configurable:
        class: 'Oro\Component\Action\Condition\Configurable'
        arguments:
            - '@oro_action.expression.assembler'
        tags:
            - { name: oro_action.condition, alias: configurable }

    oro_action.condition.extendable:
        class: Oro\Component\Action\Condition\ExtendableCondition
        arguments:
            - '@event_dispatcher'
            - '@session.flash_bag'
            - '@translator'
        tags:
            - { name: oro_action.condition, alias: extendable }

    oro_action.expression.andx:
        class: Oro\Component\ConfigExpression\Condition\Andx
        tags:
            - { name: oro_action.condition, alias: and }

    oro_action.expression.orx:
        class: Oro\Component\ConfigExpression\Condition\Orx
        tags:
            - { name: oro_action.condition, alias: or }

    oro_action.expression.not:
        class: Oro\Component\ConfigExpression\Condition\Not
        tags:
            - { name: oro_action.condition, alias: not }

    oro_action.expression.true:
        class: Oro\Component\ConfigExpression\Condition\TrueCondition
        tags:
            - { name: oro_action.condition, alias: "true" }

    oro_action.expression.false:
        class: Oro\Component\ConfigExpression\Condition\FalseCondition
        tags:
            - { name: oro_action.condition, alias: "false" }

    oro_action.expression.equal_to:
        class: Oro\Component\ConfigExpression\Condition\EqualTo
        tags:
            - { name: oro_action.condition, alias: eq|equal }

    oro_action.expression.not_equal_to:
        class: Oro\Component\ConfigExpression\Condition\NotEqualTo
        tags:
            - { name: oro_action.condition, alias: neq|not_equal }

    oro_action.expression.blank:
        class: Oro\Component\ConfigExpression\Condition\Blank
        tags:
            - { name: oro_action.condition, alias: empty|blank }

    oro_action.expression.not_blank:
        class: Oro\Component\ConfigExpression\Condition\NotBlank
        tags:
            - { name: oro_action.condition, alias: not_empty|not_blank }

    oro_action.expression.has_value:
        class: Oro\Component\ConfigExpression\Condition\HasValue
        tags:
            - { name: oro_action.condition, alias: has_value }

    oro_action.expression.has_property:
        class: Oro\Component\ConfigExpression\Condition\HasProperty
        arguments:
            - '@property_accessor'
        tags:
            - { name: oro_action.condition, alias: has_property }

    oro_action.expression.in:
        class: Oro\Component\ConfigExpression\Condition\In
        tags:
            - { name: oro_action.condition, alias: in }

    oro_action.expression.not_in:
        class: Oro\Component\ConfigExpression\Condition\NotIn
        tags:
            - { name: oro_action.condition, alias: not_in }

    oro_action.expression.not_has_value:
        class: Oro\Component\ConfigExpression\Condition\NotHasValue
        tags:
            - { name: oro_action.condition, alias: not_has_value }

    oro_action.expression.greater_than:
        class: Oro\Component\ConfigExpression\Condition\GreaterThan
        tags:
            - { name: oro_action.condition, alias: gt|greater }

    oro_action.expression.greater_than_or_equal:
        class: Oro\Component\ConfigExpression\Condition\GreaterThanOrEqual
        tags:
            - { name: oro_action.condition, alias: gte|ge|greater_or_equal }

    oro_action.expression.less_than:
        class: Oro\Component\ConfigExpression\Condition\LessThan
        tags:
            - { name: oro_action.condition, alias: lt|less }

    oro_action.expression.less_than_or_equal:
        class: Oro\Component\ConfigExpression\Condition\LessThanOrEqual
        tags:
            - { name: oro_action.condition, alias: lte|le|less_or_equal }

    oro_action.expression.acl_granted:
        class: Oro\Bundle\SecurityBundle\ConfigExpression\AclGranted
        arguments:
            - '@security.authorization_checker'
            - '@oro_security.token_accessor'
            - '@doctrine'
        tags:
            - { name: oro_action.condition, alias: acl|acl_granted }

    oro_action.expression.collection_element_value_exists:
        class: Oro\Bundle\ActionBundle\Condition\CollectionElementValueExists
        tags:
            - { name: oro_action.condition, alias: collection_element_value_exists }

    oro_action.expression.type:
        class: Oro\Component\ConfigExpression\Condition\Type
        tags:
            - { name: oro_action.condition, alias: type }

    oro_action.expression.has_elements:
        class: Oro\Component\ConfigExpression\Condition\HasElements
        tags:
            - { name: oro_action.condition, alias: has_elements }

    oro_action.expression.no_elements:
        class: Oro\Component\ConfigExpression\Condition\NoElements
        tags:
            - { name: oro_action.condition, alias: no_elements }

    oro_action.expression.condition_available:
        class: 'Oro\Component\ConfigExpression\Condition\ExpressionAvailable'
        arguments:
            - '@oro_action.expression.factory'
            - 'condition_available'
        tags:
            - { name: oro_action.condition, alias: condition_available }

    oro_action.expression.action_available:
        class: 'Oro\Component\ConfigExpression\Condition\ExpressionAvailable'
        arguments:
            - '@oro_action.action_factory'
            - 'action_available'
        tags:
            - { name: oro_action.condition, alias: action_available }

    oro_action.condition.service_exists:
        class: 'Oro\Bundle\ActionBundle\Condition\ServiceExists'
        arguments:
            - '@service_container'
        tags:
            - { name: oro_action.condition, alias: 'service_exists' }

    oro_action.condition.contains:
        class: Oro\Component\ConfigExpression\Condition\Contains
        tags:
            - { name: oro_action.condition, alias: contains }

    oro_action.condition.not_contains:
        class: Oro\Component\ConfigExpression\Condition\NotContains
        tags:
            - { name: oro_action.condition, alias: not_contains }

    oro_action.condition.start_with:
        class: Oro\Component\ConfigExpression\Condition\StartWith
        tags:
            - { name: oro_action.condition, alias: start_with }

    oro_action.condition.end_with:
        class: Oro\Component\ConfigExpression\Condition\EndWith
        tags:
            - { name: oro_action.condition, alias: end_with }
