Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses CustomEvents within ImportJobs #1961

Merged
merged 22 commits into from
Apr 4, 2024
Merged

Conversation

andyHa
Copy link
Member

@andyHa andyHa commented Apr 2, 2024

Description

Makes import jobs dispatch custom events.

grafik grafik grafik

Example Scripts:

registry.registerHandler(sirius.biz.jobs.batch.ImportJobStartedEvent.class,  |e| log(e));

registry.registerTypedHandler(sirius.biz.importer.BeforeFindEvent.class, MongoUserAccount.class, |e| log(e));

registry.registerTypedHandler(sirius.biz.importer.OnLoadEvent.class, MongoUserAccount.class, |e| log(e));

registry.registerTypedHandler(sirius.biz.importer.BeforeCreateOrUpdateEntityEvent.class, MongoUserAccount.class, |e| log(e));

Relates to:

Checklist

  • Code change has been tested and works locally
  • Code was formatted via IntelliJ and follows SonarLint & best practices
  • Patch Tasks: Is local execution of Patch Tasks necessary? If so, please also mark the PR with the tag.

If there is only one script present, it will be ued right away. Only if there are several present for the current tenant, the user can pick which
should be used. This way, a script will be automatically used everywhere if only one exists. If the script is optional, a second and empty
script can be provided.
@sabieber sabieber added the 🧬 Enhancement Contains new features label Apr 2, 2024
Base automatically changed from feature/aha/import-scripting-2 to develop April 3, 2024 08:03
andyHa added 10 commits April 3, 2024 10:04
The other load gets triggered way to often (for each find etc.)
Although currently only available to the system tenant, we plan on making the scripting API
safe in terms of sandboxing so that normal users could provide scripts as well.
Also adds a word of caution for others to maintain the sort
order.
We probably only want one event instead of one event per job type,
as the internal types are not that easy to guess.
This is mainly used for debugging purposes
@andyHa andyHa marked this pull request as ready for review April 3, 2024 09:12
@andyHa andyHa added the 🕔 Wait for sirius Needs new version from another sirius lib to work label Apr 3, 2024
@idlira idlira removed the 🕔 Wait for sirius Needs new version from another sirius lib to work label Apr 4, 2024
@idlira idlira merged commit 9a04c6d into develop Apr 4, 2024
3 of 4 checks passed
@idlira idlira deleted the feature/aha/import-scripting-3 branch April 4, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧬 Enhancement Contains new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants