ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 6 replies, has 2 voices, and was last updated by  stalxed 2 years, 9 months ago.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #6881
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, stalxed.

    There are two ways to do that:

    1) preferable solution: you can pass these variables to execution context – see this code;

    2) another solution: you can extend this reader, override variables and use it in batch job configuration.

    #6884

    stalxed
    Participant

    Thank you for answer!

    I use importexport configuration like in this bundle:
    https://github.com/orocrm/crm/blob/master/src/OroCRM/Bundle/ContactBundle/Resources/config/importexport.yml

    For example, how from OroCRMContactBundle pass this variables to execution context?
    I spent a few hours, but did not understand how to do it.

    #6885

    stalxed
    Participant

    I think I cant do it from here
    https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/ImportExportBundle/Processor/ImportProcessor.php
    In documentation he called after the read operation.
    Or am I wrong?
    If I’m not mistaken, where else can I set the context variables?(before call the function initializeFromContext in CsvFileReader).

    #6924

    stalxed
    Participant

    I found solution:
    1) Need create listener:

    2) Need register listener:

    #6930
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Good job, stalxed!

    Just a several tips:
    – alongside with “import_validation” type you should alter configuration for “import” type
    – instead of hardcoded types you can use constants ProcessorRegistry::TYPE_IMPORT_VALIDATION and ProcessorRegistry::TYPE_IMPORT

    #6942

    stalxed
    Participant

    Thanks Yevhen Shyshkin!

    I improved the code:

    Now can registe few services:

    I hope someone can help.
    I would be glad if you publish in a cookbook documentation.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.