I have created a workflow model. Where initiator/author triggers the workflow and assign the payload for approve to the approver. Approver will be triggering the process step. How can I get the approver details in process step? or how can I get the current user details in my workflow?
Solved! Go to Solution.
Views
Replies
Total Likes
To get intiator/author :
String intiator = workItem.getWorkflow().getInitiator();
to get approvar details
you have to get it from user manager api.
UserManager userManager = resolver.adaptTo(UserManager.class);
Set<String> toEmails = new TreeSet<>();
Authorizable user = userManager.getAuthorizable(authId);
validateAuthroable(userManager, toEmails, user);
Please check below examples where you can find API details.
Hi,
You can get the approver details from the workflow instance. All the information related to the workflow is stored at the /var/workflow/instances.
You can use workflow APIs to fetch the details of users who acted on this workflow instance.
To get intiator/author :
String intiator = workItem.getWorkflow().getInitiator();
to get approvar details
you have to get it from user manager api.
UserManager userManager = resolver.adaptTo(UserManager.class);
Set<String> toEmails = new TreeSet<>();
Authorizable user = userManager.getAuthorizable(authId);
validateAuthroable(userManager, toEmails, user);
Views
Likes
Replies
Views
Likes
Replies