Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. 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!