I want to build a workflow model that uses a reviewtask to manage the review process (a bespoke one that meets all the business requirements would be tricky to develop) but I have hit a snag regarding email notification.
I want to be able to identify the group associated with each review task created as part of the main review task sub-process so that I can send out an email with a link to the relevant review task. The normal CSSDK API provides no way of retrieving the group (that I have found) so I’ve been looking at using the API available specifically for WorkflowModels, using the preprocess and postprocess command properties.
Unfortunately, the getReviewerGroups() method throws a WFMAccessDeniedException if an attempt to retrieve the reviewer groups is made by a postprocess command (using the preprocess slot is pointless as the reviewers will not have been selected) but the fact that a getReviewGroups() method exists suggests that I should be able to use it somewhere – the question is where? Alternatively, if I could retrieve the workflow instance id I might be able to create a WFMWorkflow object later in the workflow process but I don’t know how to retrieve this id. It does not appear to be the same thing as the workflow id (rather surprisingly) as the following code does not work:
CSWorkflow job = currentTask.getWorkflow();
long wfinstanceid = new Long(job.getId()).longValue();
WFMWorkflowEngine wfe = WFMWorkflowEngine.getInstance();
WFMWorkflow wf = wfe.getWorkflow(wfinstanceid);
nor does:
CSWorkflow job = currentTask.getWorkflow();
long wfinstanceid = new Long(job.getId()).longValue();
WorkflowInstanceCache wfInstanceCache = new WorkflowInstanceCache();
if (wfInstanceCache.contains(wfinstanceid)) {
WFMWorkflow wf = wfInstanceCache.retreive(wfinstanceid);
}
Anyone able to help?