Is it possible to detect on what server the the current WorkBench Process is running in an Adobe AEM Workflow? We want to watermark the documents only if the Workflow is running on non-production server and we want to have the same workflows on both production and non-production servers.
Just a thought.
Probably in the process args passed to the workflow we can pass the environment details say dev, which will be picked up later in the code to determine the route that its got to take.
Views
Replies
Total Likes
You can do a check on run mode.That can help you
BjornEricsson wrote...
Is it possible to detect on what server the the current Workflow is running in an Adobe AEM Workflow? We want to watermark the documents only if the Workflow is running on non-production server and we want to have the same workflows on both production and non-production servers.
You can get this done by using the org.apache.sling.settings.SlingSettingsService
Example code snippet that can print the run modes in your JSP shown below, same can be used in your OSGI JAVA logic.
<%@page import="org.apache.sling.settings.SlingSettingsService%> <% pageContext.setAttribute("runModes", sling.getService(SlingSettingsService.class).getRunModes().toString()); %><%= pageContext.getAttribute("runModes") %>
above code snippet prints output in JSP as [samplecontent, author, crx3tar, crx3] where my local instance is running in author mode with samplecontent. which can be found in your instance at /system/console/status-slingsettings.
Views
Replies
Total Likes
I Think that I used the wrong wording in my original post. I want to detect server type in a Workbench Process. Is that doable with this approach?
Views
Replies
Total Likes
BjornEricsson wrote...
I Think that I used the wrong wording in my original post. I want to detect server type in a Workbench Process. Is that doable with this approach?
There is a difference between the Workflow and Workbench (Workbench is an integrated development environment (IDE) that developers use to create and manage AEM forms applications and assets.) in AEM terminology, AFAIK "It is not possible to run Workbench processes with AEM Workflows" and looks like your requirement needed to have a custom workflow and a custom process step which can do your functionality.
Views
Replies
Total Likes
BjornEricsson wrote...
I Think that I used the wrong wording in my original post. I want to detect server type in a Workbench Process. Is that doable with this approach?
What do you mean by "server type" if not author vs. publisher? or dev/testing environment vs PROD environment?
Both of these scenarios can be covered by checking run modes, you would just need to include a few extra run modes for each environment (integration, staging, production).
Greg is correct in this response. Run modes is the solution here.
Views
Replies
Total Likes
Yes, I have read about that elsewhere .How do I write a transition expression, in the Workbench, that detects run mode?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies