Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi all,
I'm editing Variance Workflow via Workflow Manger.
I have the PrimaryBusinessObject variable. But how can I get the appropriate Workitem object?
Thanks a lot
Solved! Go to Solution.
There are few method available in workflowhelper to get the workitem from PBO.below are the some methods you select based on your requirement.
WorkflowHelper.service.getWorkItems( Persistable ,WTPrincipal , Role );
WorkflowHelper.service.getWorkItems(Persistable );
WorkflowHelper.service.getWorkItems(Persistable ,String);
WorkflowHelper.service.getWorkItems(Persistable ,String);
WorkflowHelper.service.getWorkItems(Persistable , WTPrincipal , String );
Example
// get all all activity of the Approver role for given PBO (Promtion Request )
QueryResult workitems = WorkflowHelper.service.getWorkItems(PBO, Role.toRole("APPROVER_MANDATORY"));
while (workitems.hasMoreElements()) {
WorkItem tmpworkitems = (WorkItem) workitems.nextElement();
System.out.println("Inside WorkItems");
workItemsVector.add(tmpworkitems);
if (tmpworkitems.isComplete()) {
System.out.println("Workitem is completed ");
} else {
System.out.println("Workitem is not completed ");
}
}
hope this helps !!!
Thanks,
Shreyas
There are few method available in workflowhelper to get the workitem from PBO.below are the some methods you select based on your requirement.
WorkflowHelper.service.getWorkItems( Persistable ,WTPrincipal , Role );
WorkflowHelper.service.getWorkItems(Persistable );
WorkflowHelper.service.getWorkItems(Persistable ,String);
WorkflowHelper.service.getWorkItems(Persistable ,String);
WorkflowHelper.service.getWorkItems(Persistable , WTPrincipal , String );
Example
// get all all activity of the Approver role for given PBO (Promtion Request )
QueryResult workitems = WorkflowHelper.service.getWorkItems(PBO, Role.toRole("APPROVER_MANDATORY"));
while (workitems.hasMoreElements()) {
WorkItem tmpworkitems = (WorkItem) workitems.nextElement();
System.out.println("Inside WorkItems");
workItemsVector.add(tmpworkitems);
if (tmpworkitems.isComplete()) {
System.out.println("Workitem is completed ");
} else {
System.out.println("Workitem is not completed ");
}
}
hope this helps !!!
Thanks,
Shreyas
Thanks a lot!