How to cancel a document publish request, through java

25 views
Skip to first unread message

hariva...@gmail.com

unread,
Jun 13, 2017, 7:11:58 AM6/13/17
to Hippo Community
Hi guys,

I have created a document through java. The user is sitewriter and appropriate permissions have been given to this user. The workflow persistence manager is used as such-

workflowPersistenceManager.setWorkflowCallbackHandler(new BaseWorkflowCallbackHandler<DocumentWorkflow>() {
public void processWorkflow(DocumentWorkflow wf) throws Exception {
wf.requestPublication();
}
});

This creates a document which requests for publication, which will be approved by the author. 

Now, my use case is - i want to withdraw/ cancel this request. How will i go about doing that? 

Tried using wf.cancelRequest() among other things but it didnt work. maybe i missed something?

hariva...@gmail.com

unread,
Jun 13, 2017, 2:27:11 PM6/13/17
to Hippo Community
Never mind. I got the answer. Posting here in case someone winds up here, looking for the same answer. 
 
    Node handleNode = persistableSession.getNode(handleNodePath);
Node requestNode = handleNode.getNode("hippo:request");
DocumentWorkflow wf = (DocumentWorkflow) workflowPersistenceManager.getWorkflow(DEFAULT, handleNode);
wf.cancelRequest(requestNode.getIdentifier()); 

Hope this helps :)

Jasper Floor

unread,
Jun 14, 2017, 4:43:42 AM6/14/17
to Hippo Community
Hi,

sorry no one responded to your question (sometimes we are busy :( ). Thanks for reporting back, it is appreciated.

mvg,
Jasper

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

hariva...@gmail.com

unread,
Jun 14, 2017, 6:39:49 AM6/14/17
to Hippo Community
Its quite alright Jasper. :) I get it, the barrage of questions, doubts, complaints. 

Though on the same vein, would you mind having a look at this question - 

Each approach I take towards this seems to have a loophole. Perhaps you could suggest something?


On Wednesday, June 14, 2017 at 2:13:42 PM UTC+5:30, jasper.floor wrote:
Hi,

sorry no one responded to your question (sometimes we are busy :( ). Thanks for reporting back, it is appreciated.

mvg,
Jasper
On Tue, Jun 13, 2017 at 8:27 PM, <hariva...@gmail.com> wrote:
Never mind. I got the answer. Posting here in case someone winds up here, looking for the same answer. 
 
    Node handleNode = persistableSession.getNode(handleNodePath);
Node requestNode = handleNode.getNode("hippo:request");
DocumentWorkflow wf = (DocumentWorkflow) workflowPersistenceManager.getWorkflow(DEFAULT, handleNode);
wf.cancelRequest(requestNode.getIdentifier()); 

Hope this helps :)

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages