cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How to get Workitem?

Stanley
12-Amethyst

How to get Workitem?

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

ACCEPTED SOLUTION

Accepted Solutions
satre-2
12-Amethyst
(To:Stanley)

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

View solution in original post

2 REPLIES 2
satre-2
12-Amethyst
(To:Stanley)

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

Stanley
12-Amethyst
(To:satre-2)

Thanks a lot!

Announcements


Top Tags