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

[Feature] Workflow Migration #2325

Merged

Conversation

auslin-aot
Copy link
Contributor

@auslin-aot auslin-aot commented Nov 4, 2024

Issue Tracking

JIRA:
Issue Type: BUG/ FEATURE
https://aottech.atlassian.net/browse/FWF-3718
https://aottech.atlassian.net/browse/FWF-3841

Changes

Workflow Migration

  • Added is_migrated flag in mapper table
  • Update process_name column of form "Two Step Approval (two-step-approval)" to "Two Step Approval"
  • Added request argument mapperId to get by process key API to support migration.
    If process_key is not found, if the mapper is not migrated then workflow fetched from camunda
    - http://localhost:5000/process/key/<process-key>?mapperId=1
  • Added new POST API http://localhost:5000/process/migrate with payload { "mapperId":"mapper-id", "processKey":"process_key"}
  • Changes in process list api to fetch from camunda if process list is empty

Screenshots

image
Migrate api
image

Checklist

  • Updated changelog
  • Added meaningful title for pull request

@auslin-aot auslin-aot force-pushed the FWF-3718-workflow-migration branch 2 times, most recently from 7e48501 to 720e902 Compare November 5, 2024 08:55
@auslin-aot auslin-aot force-pushed the FWF-3718-workflow-migration branch from 720e902 to 1ac5851 Compare November 5, 2024 09:20
@auslin-aot auslin-aot marked this pull request as ready for review November 5, 2024 09:24
@auslin-aot auslin-aot requested review from a team as code owners November 5, 2024 09:24
@classmethod
def migrate(cls, request):
"""Migrate by process key."""
current_app.logger.debug("Migrate process started..")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration needs to happen only for all the other mappers with same process_key and keep the same for the one which initiates it. For e.g, if Workflow1 is used by Form1, Form2 and Form3. Then when the user saves Form2 and decides to keep the workflow for that form, then Form1 and Form3 needs new workflow (cloned)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
yes picking the mappers excluding the mapperId provided in the payload & adding the new workflow for other form mappers


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('form_process_mapper', sa.Column('is_migrated', sa.Boolean(), nullable=True, comment="Is workflow migrated", server_default='false'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also need to set the value to TRUE for workflows (process) with only one form linked, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of now, it's done as part of getting by process key API. After fetching from camunda & is_migrated set to True for workflows (process) with only one form.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Added is_migrated TRUE for workflows with only one form linked to the migration file
image

@arun-s-aot arun-s-aot merged commit e930918 into AOT-Technologies:develop Nov 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants