Custom Step Workflow with Ecma script

Avatar

Avatar
Give Back
Level 1
Manlosa
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile

Avatar
Give Back
Level 1
Manlosa
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile
Manlosa
Level 1

19-07-2021

Hi there, 

    Newbie here. Does anyone know of a good working example of a workflow step written in Ecma Script? Also, looking for some step-by-step or best practices in building workflow step using Ecma Script.

 

Thanks,

-Leo

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

119 likes

Total Posts

249 posts

Correct reply

38 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

119 likes

Total Posts

249 posts

Correct reply

38 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile
snbaem
Level 6

19-07-2021

Hi,

Please follow https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-wor...

You can see example scripts under /libs/workflow/scripts/ but as mentioned in the documentation do not change anything there. You will have to create a structure under /apps  and add the file there.

 

Eg

var workflowData = graniteWorkItem.getWorkflowData();
if (workflowData.getPayloadType() == "JCR_PATH") {
    var path = workflowData.getPayload().toString();
    var jcrsession = graniteWorkflowSession.adaptTo(Packages.javax.jcr.Session);
    var node = jcrsession.getNode(path);
    //Custom code - some action on the node..
}

Here - https://experienceleague.adobe.com/docs/experience-manager-64/forms/workflows/dynamically-select-a-u... two scrips under " /apps/fd/dashboard/scripts/" is described 

More links -https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-wor...

https://github.com/AdobeDocs/experience-manager-64.en/blob/master/help/sites-developing/workflows-pr... 


Answers (0)