Expand my Community achievements bar.

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

Avatar

Level 1

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!

Gokulr_aem_0-1722076677133.png

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

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Community Advisor

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.

Avatar

Level 1

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

Avatar

Level 4

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..