Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Update workflow model labels

Avatar

Level 3

Looking for the best approach to update workflow modal label for a specific workflow not for all

 

Screenshot 2023-10-13 at 8.48.32 PM.png

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 2

@Nilesh_Mali, there is a workaround that I could implement for one of my requirement,

Created a "cq:ClientLibraryFolder" folder under components in ui.apps.

Set categories as below

categories="[coralui3,coralui2]"

and in the js.txt, add a new file with below code

(function(document, $) {
    'use strict';
    $(document).on('foundation-contentloaded', function(e) {
        var selection = $(".foundation-collection-item.foundation-selections-item.is-selected");
        if (selection !== null) {
            var itemPath = selection.data("foundationCollectionItemId");
            if (itemPath === '/var/workflow/models/YOUR-WORKFLOW-MODEL') {
                $("input[name='model']").closest('form').find($("textarea[name='startComment']").prev('label')).html('TEXT-TO-REPLACE');
            }
        }
    });
})(document, Granite.$);

 

Here, itemPath is your Workflow model path in case you want the changes to be specific to a particular WorkFlow.

 

Hope this workaround works for you!

 

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @Nilesh_Mali

 

You want to change the "comment" label to something else for a particular WF?
Is this your query?

Avatar

Level 3

Yes. I want to change the "comment" label to something else for a particular WF.

Avatar

Community Advisor

Hi @Nilesh_Mali 

 

We cannot overlay these nodes and hence won't be able to customize it.

Hope it helps.

 

Screenshot 2023-10-17 at 5.18.18 PM.png

Avatar

Level 6

Hi @Nilesh_Mali ,

 

I am not sure how to customize this for a specific model although this value is coming from "/libs/cq/workflow/admin/console/content/models/runmodeldialog/items/form/items/startComment".

 

You can try adding a new button to the Workflow console for your custom requirement. 

 

Below article demonstrates how you can do it for Sites console. You can follow similar steps and do it for Workflow models view instead.

 

AEM - How to add a custom button to the sites.html and render it based on specific paths ? (linkedin...

 

e.g. target should be ".cq-workflow-admin-models" instead of ".cq-siteadmin-admin-childpages"

 

Thanks,

Ram

Avatar

Administrator

@Nilesh_Mali Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Correct answer by
Level 2

@Nilesh_Mali, there is a workaround that I could implement for one of my requirement,

Created a "cq:ClientLibraryFolder" folder under components in ui.apps.

Set categories as below

categories="[coralui3,coralui2]"

and in the js.txt, add a new file with below code

(function(document, $) {
    'use strict';
    $(document).on('foundation-contentloaded', function(e) {
        var selection = $(".foundation-collection-item.foundation-selections-item.is-selected");
        if (selection !== null) {
            var itemPath = selection.data("foundationCollectionItemId");
            if (itemPath === '/var/workflow/models/YOUR-WORKFLOW-MODEL') {
                $("input[name='model']").closest('form').find($("textarea[name='startComment']").prev('label')).html('TEXT-TO-REPLACE');
            }
        }
    });
})(document, Granite.$);

 

Here, itemPath is your Workflow model path in case you want the changes to be specific to a particular WorkFlow.

 

Hope this workaround works for you!