How to show a custom dialog in EMCA ? | Community
Skip to main content
vikramca06
Level 4
October 16, 2015
Solved

How to show a custom dialog in EMCA ?

  • October 16, 2015
  • 3 replies
  • 1528 views

Hi,

I am trying to call a custom dialog in ECMA workflow step. I am getting the following error.

Caused by: org.apache.sling.api.scripting.ScriptEvaluationException: Failure running script /etc/workflow/scripts/clientlibs/test/customworkflow.ecma: ReferenceError: "CQ" is not defined. (/etc/workflow/scripts/clientlibs/test/customworkflow.ecma#21)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
    at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:193)
    ... 5 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "CQ" is not defined. (/etc/workflow/scripts/clientlibs/test/customworkflow.ecma#21)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
    at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3413)
    at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1612)
    at org.mozilla.javascript.gen.c25._c0(/etc/workflow/scripts/clientlibs/test/customworkflow.ecma:21)
    at org.mozilla.javascript.gen.c25.call(/etc/workflow/scripts/clientlibs/test/customworkflow.ecma)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
    at org.mozilla.javascript.gen.c25.call(/etc/workflow/scripts/clientlibs/test/customworkflow.ecma)
    at org.mozilla.javascript.gen.c25.exec(/etc/workflow/scripts/clientlibs/test/customworkflow.ecma)
    at org.mozilla.javascript.Context.evaluateReader(Context.java:1227)
    at org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine.eval(RhinoJavaScriptEngine.java:114)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
    ... 7 more


Please tell me how to get the CQ object in ecma script to show or hide custom dialog.

Thanks in advance.

Vikram.

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

Hi,

Not sure what you're trying to do exactly, this sounds a bit confused.  If you want to use a custom dialog for a step in a workflow you must use the Dialog Participant Step.  Or perhaps you're trying to execute an ecma script as a step in a workflow - when you do this there is no CQ object defined.  

See here for what is provided to you by the workflow engine when you script is executed as a workflow step [0].  If you want to create a dialog for a participant step see here [1].

Hope this helps,

Will

[0] http://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-extending.html#Developing Process Step Implementations --> "Implementing a Process Step with an ECMA Script"

[1] http://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-ref.html#Dialog Participant Step

3 replies

smacdonald2008
Level 10
October 16, 2015

Read the CQ documentaton located here:

http://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-extending.html#Accessing Dialog Property Values at Runtime

IN this doc topic - there is mention of ECMA. However - i am not seeing mention of a custom dialog. I will ask eng team to help here. 

vikramca06
Level 4
October 16, 2015

Hi Scott,

Thanks for your reply.

I am also referring the same page for ECMA scripts.

If you could get me help from eng team that will be really helpful.

Thanks.

Vikram.

WillMc1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Hi,

Not sure what you're trying to do exactly, this sounds a bit confused.  If you want to use a custom dialog for a step in a workflow you must use the Dialog Participant Step.  Or perhaps you're trying to execute an ecma script as a step in a workflow - when you do this there is no CQ object defined.  

See here for what is provided to you by the workflow engine when you script is executed as a workflow step [0].  If you want to create a dialog for a participant step see here [1].

Hope this helps,

Will

[0] http://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-extending.html#Developing Process Step Implementations --> "Implementing a Process Step with an ECMA Script"

[1] http://docs.adobe.com/docs/en/cq/5-6-1/workflows/wf-ref.html#Dialog Participant Step