Hi all,
I have a use case where I need an Java client app to get info if a workflow has been completed.
I want to do this using the JCR so where can I got in on CRXDE to get archives, instances, failures and such.
/etc/workflow/instances/ ????
Thanks All!
Solved! Go to Solution.
Views
Replies
Total Likes
JCR nodes only give you workflow models - not running status, etc.
You need to use the Workflow API. However - you cannot use this API from outside of AEM. A Java client cannot use it, You need to use it within AEM.
So what you have to do is write an AEM Sling servlet that uses the Workflow API to get workflow info. Then return the info as part of a GET request. ie - place it in JSON or XML.
Now you can write a Java client app that can communicate with the Sling Servlets via GET requests. The Java app will get the JSON or XML and display it.
We have a community article that will help you with the Java Client interacting with AEM. In this example, the Java client interacts with AEM via a HTTP POST operation.
https://helpx.adobe.com/experience-manager/using/post_files.html
In your example - you may want to perform GET requests.
Views
Replies
Total Likes
Hey - is your requirement a separate Java client app that is running outside of AEM?
Views
Replies
Total Likes
The API you would use to perform this use case is https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/adobe/granite/workflow/exec/Workflow.html. Look at all of the classes in this Javadoc. You use this API in a Sling Servlet or an AEM service.
Views
Replies
Total Likes
smacdonald2008 wrote...
Hey - is your requirement a separate Java client app that is running outside of AEM?
Yes it would be. Is there no way of getting this info from nodes and nodes property?
I'll take a look at that API.
Thanks!
Views
Replies
Total Likes
JCR nodes only give you workflow models - not running status, etc.
You need to use the Workflow API. However - you cannot use this API from outside of AEM. A Java client cannot use it, You need to use it within AEM.
So what you have to do is write an AEM Sling servlet that uses the Workflow API to get workflow info. Then return the info as part of a GET request. ie - place it in JSON or XML.
Now you can write a Java client app that can communicate with the Sling Servlets via GET requests. The Java app will get the JSON or XML and display it.
We have a community article that will help you with the Java Client interacting with AEM. In this example, the Java client interacts with AEM via a HTTP POST operation.
https://helpx.adobe.com/experience-manager/using/post_files.html
In your example - you may want to perform GET requests.
Views
Replies
Total Likes
yeah , "/etc/workflow/instances" node has all the workflow instances (archived,running etc.).
If you read the "status" proeprty, will get to know workflow status(COMPLETED/RUNNING/ABORTED).
/etc/workflow/instances/server0/2016-01-13_9/model_XXX/@status
Views
Replies
Total Likes
Will - our Workflow Eng stated:
"Always better to use API. It’s only an implementation detail that it’s stored in the repo."
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies