Answer by rickett (14292) | Jul 17, 2015 at 01:54 PM
Using a custom workflow action which runs when entering a stage. This action makes API call getCurrentApprovers() to get the approvers for the current stage. However, this call is returning the approvers for the previous stage.
Solution:
The getCurrentApprovers() call should be invoked on the content or document passed in to the custom action in the execute(Document p_document) method. Only this object would contain the approvers for the current stage. If instead you use the object which was retrieved from the repository using the inWorkspace.getById() call (in WorkflowUtil class), the object retrieved from the repository would be the one from the previous save and hence it would contain all information for the earlier stage.
This general process/pseudocode to implement:
Get the docId of the content
Create a new Workspace
Set to use DN workspace.useDistinguishedNames(true);
Content myContent =(Content)ws.getById(thisId);
String approvers = myContent.getCurrentApprovers()
staleValueException using WCM API from an EJB 1 Answer
Error using WCM API IWKWC0010W Unauthorized access by {PrincipalInformation: {dn: anonymous_user 1 Answer
WCM API Sample Code to render Authoring Tools Component from a JSP using tag library 1 Answer
Using WCM API to search for Pages in Portal Site library. 1 Answer