WCMMode in Workflow scripts? Determine Author/Publisher in Workflow steps | Community
Skip to main content
Sharadkap
New Participant
October 16, 2015
Solved

WCMMode in Workflow scripts? Determine Author/Publisher in Workflow steps

  • October 16, 2015
  • 3 replies
  • 1821 views

I have a requirement where I need to check the mode (author/publisher) in the workflow step.

There is different workflow for both of these wcm modes. 

I was trying to write function check() using the api WCMMode.

I know there is a way to do it in the components/jsp however the same seems to be not working in the workflows:

Is there anything like the below in workflows (this is to be inside function check)?

var WCMMode = sling.getService(Packages.com.day.cq.wcm.api.WCMMode);

 

If you have any other suggestions/solutions, please do advise. 

 

Thanks!!

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

Hey Sharad,

If you want to control whole work flow whether it has to run or not you can control it in the launcher configuration in which mode it has to trigger.

If you want to controll only particular step inside the workflow then you can used some code which will tell in which mode that workflow is running. Use run modes concepts for identifying in which mode instance is running,

 Search  with "how to check run modes in adobe day cq" you will get lot of results for setting run modes or simply accessing and identifying in which mode cq instance is running.

3 replies

Accepted solution
October 16, 2015

Hey Sharad,

If you want to control whole work flow whether it has to run or not you can control it in the launcher configuration in which mode it has to trigger.

If you want to controll only particular step inside the workflow then you can used some code which will tell in which mode that workflow is running. Use run modes concepts for identifying in which mode instance is running,

 Search  with "how to check run modes in adobe day cq" you will get lot of results for setting run modes or simply accessing and identifying in which mode cq instance is running.

Sharadkap
SharadkapAuthor
New Participant
October 16, 2015

maruthid wrote...

Hey Sharad,

If you want to control whole work flow whether it has to run or not you can control it in the launcher configuration in which mode it has to trigger.

If you want to controll only particular step inside the workflow then you can used some code which will tell in which mode that workflow is running. Use run modes concepts for identifying in which mode instance is running,

 Search  with "how to check run modes in adobe day cq" you will get lot of results for setting run modes or simply accessing and identifying in which mode cq instance is running.

 

 

Hey thanks Maruthi. 

I am using the OOTB workflow moderation in which there is a requirement to identify from which environment the workflow has been triggered. It is getting difficult to identify so I was using a OR split inside the OOTB workflow and in that trying to write the logic for function check. This is an ecma script and getting WCMMode (or any thing related to the check on modes) is freaking me out. Is there a way to identify the mode in the function check or any other way?

I cant change the launcher that is the limitation. 

Thanks,

Sharad

Employee
October 16, 2015

I think you are looking for the SlingSettingService. See this thread: http://forums.adobe.com/thread/1020051