Hi guys,
I want to add workflow to check if the page is active or not? I have try with following code, but couldn't get success;
function check() {
if (workflowData.getPayloadType() == "JCR_PATH") {
var path = workflowData.getPayload().toString();
var node = workflowSession.getSession().getItem(path);
if(node.hasProperty("cq:lastReplicationAction") && node.getProperty("cq:lastReplicationAction").getString() == "Activate") {
return true;
} else {
return false;
}
} else {
// should not happen
return false;
}
}
Beside how I can see log for ECMA script after I added line log.error or log.info?
Is there any website or tutorial I can refer to create ECMA script for OR function workflow?