Modified AEM create workflow page with added new field and need to add the field data to workflow meta data | Community
Skip to main content
New Member
July 27, 2024
Question

Modified AEM create workflow page with added new field and need to add the field data to workflow meta data

  • July 27, 2024
  • 3 replies
  • 894 views

Hi Communities,

I'm working in the task of adding new field in create workflow page and I added it
But the added data are not added in the workflow metadata.
I don't know, How to add the new field data to workflow meta data.
I'm checking in the workflow instance but only workflow title and workflow model are present in the meta data
please tell me how to added the data when the workflow is started!

How to added the user data to workflow metadata when the start button clicked!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Ravi_Pampana
Community Advisor
Community Advisor
July 29, 2024

Hi ,

 

To add the user data to the workflow metadata when the start button is clicked in an AEM workflow, you can follow these steps:

1. Update the Workflow Model
    - Open the AEM Workflow Model Editor.
    - Add a custom process step that will handle the addition of the new field data to the workflow metadata.

2. Create a Custom Workflow Process
   - Implement a custom workflow process that extends the "WorkflowProcess" interface.
   - This custom process will read the new field data and add it to the workflow metadata.

3. Deploy the Custom Workflow Process
   - Deploy your custom workflow process to the AEM instance.

4. Configure the Workflow Model:
   - Go back to the AEM Workflow Model Editor.
   - Add the custom process step to the workflow model and configure it to use the newly created  "AddUserDataToWorkflowMetadata" process.
   - Ensure that the step is placed appropriately in the workflow sequence to ensure that it executes at the right time.

5. Update the Workflow Initiation Code (if needed):
   - If your workflow is started programmatically, ensure that the new field data is passed correctly when initiating the workflow.

New Member
July 30, 2024

Yes, I understand but when the workflow is start then I checked the metaData, workflowItem, workflowItem.getMetaData, but its not getting into the process step only workflow model and workflowTitle are here. Any other idea to get data into MetaDataMap

MetaDataMap
Level 3
July 30, 2024

Hi @gokulr_aem,

 

Can you please elaborate more on this, where you are trying to create a new field and if it is entering into your process step ?

If possible please share your code how you are fetching MetaData as well..

kautuk_sahni
Community Manager
Community Manager
September 4, 2024

@gokulr_aem Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni