Expand my Community achievements bar.

SOLVED

Workflow_use dialog participant step data in or split

Avatar

Level 2

Hello everyone!

 

I’m using a DIALOG PARTICIPANT STEP in a workflow I’m implementing in CQ 5.6.1.
The Dialog consists in various checkboxes and the executor of the step will select some or none, depending on the situation.

After the DIALOG STEP, there’s NO OPERATION STEP and then an OR SPLIT. In the script of this OR SPLIT I’d like to retrieve the data from the Dialog and use it for the logic implementation.

 

I’ve tried the two approaches listed in the Workflow Step Reference (http://dev.day.com/docs/en/cq/current/workflows/wf-ref.html#Dialog Participant Step):

 

  1.       Storing data in the Workitem: the data of this dialog was stored in some variables in the workflow metadata.

The path I found them was: /etc/workflow/instances/<date>/<model>/<history>/xxx/propertyname

 

I’ve tried several ways of accessing their values through the OR SPLIT script but I didn’t succeeded.

 

  1.       Storing data in the Payload: the data of this dialog was stored in some variables in the payload metadata.

The path I found them was: /content/<website>/<page>/jcr:content/<nodename>/propertyname

 

I’ve also tried several ways of accessing their values through the OR SPLIT script but I didn’t succeeded:

  1.      Through the PERSISTING DATA FOR SUBSEQUENT WORKFLOW STEPS (http://dev.day.com/docs/en/cq/current/workflows/wf-extending.html#Persisting%20Data%20for%20Subseque...)

 

  1.       Through the example given inside the workflow editor:

 

function check() {

if (workflowData.getPayloadType() == "JCR_PATH") {

var path = workflowData.getPayload().toString();

var node = workflowSession.getSession().getItem(path);

if (node.getProperty("propertyname").getString().equals("on")) {

return true;

}

}

return false;

}

 

I’ve also added this code to the .jsp file of the component where the dialog is located.

 

String criacaook = properties.get("criacaook", String.class);

                String seook = properties.get("seook", String.class);

                String waok = properties.get("waok", String.class);

                String h2wok = properties.get("h2wok", String.class);

                String ofertaok = properties.get("ofertaok", String.class);

                String midiaok = properties.get("midiaok", String.class);

Does anyone know some documents/tutorials/guidelines that could help me? Or even how to do it?

 

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks for the answer Scott!

 

I can't tell you exactly why, but I made it work yesterday!

But it only works (retrieve the data) when I write down the script in the workflow editor, when I try to reference a script in /etc/workflow/scritps it does not work...

Would you know what I'm doing wrong?

Thanks!

View solution in original post

4 Replies

Avatar

Correct answer by
Level 2

Thanks for the answer Scott!

 

I can't tell you exactly why, but I made it work yesterday!

But it only works (retrieve the data) when I write down the script in the workflow editor, when I try to reference a script in /etc/workflow/scritps it does not work...

Would you know what I'm doing wrong?

Thanks!

Avatar

Level 8

Offhand I don't know why it wouldn't work when referencing the script. Perhaps you can post the script?

Edit: make sure your script file name has the .ecma extension

Avatar

Level 2

Hey Scott, thanks for the answer!

The script was the check function I posted...]

But I'm using  the component field in the workflow editor...