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

[ENH] MongoDB storage for alterations #5554

Closed
rosca-sabina opened this issue Jun 7, 2024 · 4 comments
Closed

[ENH] MongoDB storage for alterations #5554

rosca-sabina opened this issue Jun 7, 2024 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@rosca-sabina
Copy link
Contributor

Enhancement Request

Enhancement Overview

Elsa Workflows doesn't currently support using MongoDB as a storage provider for alteration plans and jobs out of the box.

As such, users who want to use MongoDB as persistent storage for both alterations and other functionalities (such as workflow runtime or management) have to either implement their own IAlterationJobStore and IAlterationPlanStore using MongoDB, or to use a different storage provider just for alterations.

Proposed Enhancement

Provide MongoDB implementations for IAlterationJobStore and IAlterationPlanStore, and an extension method to allow users to configure AlterationsFeature to use MongoDB as storage.

Use Cases

Users who want to use MongoDB as a storage provider for alterations would benefit from this enhancement.

Impact of Enhancement

This enhancement would improve user experience and productivity for users that use alterations by offering support for MongoDB storage out of the box.

@rosca-sabina rosca-sabina added the enhancement New feature or request label Jun 7, 2024
Copy link

glime-ai bot commented Jun 7, 2024

To implement MongoDB as a storage provider for alteration plans and jobs in Elsa Workflows, you would need to create custom implementations of IAlterationJobStore and IAlterationPlanStore interfaces that interact with MongoDB. Additionally, you would need to provide an extension method to configure the AlterationsFeature to use MongoDB for storage.

Here's a high-level overview of the steps you would need to take:

  1. Implement IAlterationJobStore and IAlterationPlanStore with MongoDB:

    • Create classes that implement these interfaces.
    • Use the MongoDB .NET driver to interact with MongoDB collections within these implementations.
  2. Create an Extension Method:

    • Develop an extension method for IServiceCollection that registers your MongoDB store implementations with the DI container.
    • This method should also configure the AlterationsFeature to use these implementations.
  3. Register the Stores:

    • Use the extension method within your application's startup configuration to register the MongoDB stores.
  4. Test the Implementation:

    • Ensure that your MongoDB stores correctly handle CRUD operations for alteration jobs and plans.
    • Verify that alterations are correctly persisted and can be retrieved from MongoDB.
  5. Documentation and Examples:

    • Provide documentation on how to configure and use the MongoDB stores.
    • Include examples that demonstrate the setup and usage.
  6. Considerations for Official Support:

    • If you're looking for official support for MongoDB storage for alterations, consider contributing to the Elsa Workflows project by submitting a pull request with your implementation.
    • Engage with the community and maintainers on GitHub to discuss the potential inclusion of your enhancement in the official Elsa Workflows repository.

Please note that this is a non-trivial enhancement that requires a good understanding of both Elsa Workflows' internals and MongoDB. If you're not familiar with implementing custom storage providers in Elsa, it would be beneficial to review the existing storage provider implementations for guidance.

Would you like more detailed guidance on any of these steps or assistance with a specific part of the implementation?

This comment was generated by Glime.

@rosca-sabina
Copy link
Contributor Author

@sfmskywalker Should this be added to the Elsa 3.2 milestone?

@sfmskywalker
Copy link
Member

Yes, thank you.

@sfmskywalker sfmskywalker moved this to Done in ELSA 3 Jun 11, 2024
@sfmskywalker sfmskywalker added this to the Elsa 3.2 milestone Jun 11, 2024
@rosca-sabina
Copy link
Contributor Author

Nice, closing the issue since it was resolved in PRs #5555 and #5564. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants