What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all - does someone know how I can check whether a newly defined behavior has been correctly appli

Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi all - does someone know how I can check whether a newly defined behavior has been correctly applied to a table?
(It does not seem to work, so I'd assume not, but it might also be some other problem elsewhere, so I'd like to check the behavior first.)

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    did u already see the generated orm base class?

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yep, it does have e.g. an saveEventBehaviorEntityChange method, so I guess that should mean that the behavior is there.

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2022

    However, according to its code, this method should also create an entry in the spy_event_behavior_change table - but it doesn't. Even though I stepped it through with debugger and everything seemed OK: it created the entity, supplied all the data and did a save() on it without errors. But still, the spy_event_behavior_change table remains empty.

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    Did u checked if this is active or not \Spryker\Zed\EventBehavior\EventBehaviorConfig::$isEventDisabled ? I.e. during data-import is disabled and nothing is written in spy_event_behavior_change

    Are u testing it in import process or via backoffice save operation?

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2022

    \Spryker\Zed\EventBehavior\EventBehaviorConfig::$isEventDisabled is false.

    Backoffice save, I believe. I'm just following the https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-publishing/handle-data-with-publish-and-synchronization.html#[…]e
    tutorial. I'm now at the "Verification
    Ensure that the event has been created:" part but I don't see any events for my newly created queue in RabbitMQ.

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    another thing that u have to keep in mind.... there is a console post hook that consume the data in the table after running a command
    \Pyz\Zed\Console\ConsoleDependencyProvider::getConsolePostRunHookPlugins and also in event dispatcher in zed/backoffice/backend-gateway etc...

    \Pyz\Zed\EventDispatcher\EventDispatcherDependencyProvider::getEventDispatcherPlugins
    \Pyz\Zed\EventDispatcher\EventDispatcherDependencyProvider::getBackendGatewayEventDispatcherPlugins

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    i would in your case stop jenkins to ensure that the event is not consumed so quickly that u don't see it in rmq... and if the event is properly generated then u should see it in rmq

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

    Stopping Jenkins was part of the tutorial and I did that too. (Just checked again, it really is suspended, so that's not the problem.)

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    did u try to change some value in IndexController before save call? because the event is generated only if there are some affected rows... otherwise no event is again generated

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

    No. There are affected rows. Every time I reload the Controller, I get the success message and I can see another new entry in the spy_hello_world_message table.

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

    ahhhhhh....
    multistore πŸ˜›
    I'm using the base b2b demoshop for the tutorial, which is multistore by default (AT, DE, US). I'm working with the DE store and didn't even notice that I was checking the AT queues in RabbitMQ. Of course there was nothing there... But then I scrolled down, found the DE queues, and all my messages are there, as they should be. So everything OK. πŸ™‚

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

    Still, thank you for your time and help, @UL65CH0MC. I'll take note of your hints, should still come in handy for the future. πŸ™‚ πŸ‘

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ah cool that u find your problem.... then everything is working as expected...

  • Posts: 91 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yep πŸ™‚

Welcome!

It looks like you're new here. Sign in or register to get started.