[jboss-user] [jBPM] - Re: How to Complete a WorkItem using REST API

analamala do-not-reply at jboss.com
Wed Oct 12 17:06:36 EDT 2011


analamala [http://community.jboss.org/people/analamala] created the discussion

"Re: How to Complete a WorkItem using REST API"

To view the discussion, visit: http://community.jboss.org/message/631454#631454

--------------------------------------------------------------
Thank you Chris. Your feedback is again very valuable. I took approach 1 and everything worked perfectly at the end. Here is what I did.

* gwt-console-server\WEB-INF\lib\jbpm-gwt-core-5.1.0.Final.jar\org\jbpm\integration\console\CommandDelegate.java. Added the following method.
public void completeWorkItem(String workItemId,
            Map<String,Object> results) {
        ksession.getWorkItemManager().completeWorkItem(
                new Long(workItemId).longValue(), results);
    }

* gwt-console-server\WEB-INF\lib\jbpm-gwt-core-5.1.0.Final.jar\org\jbpm\integration\console\ProcessManagement.java. Added the following two methods
public void completeWorkItem(String workItemId) {
        delegate.completeWorkItem(workItemId, null);        
    }    

    @Override
    public void completeWorkItem(String workItemId, Map<String,Object> results) {
        delegate.completeWorkItem(workItemId, results);        
    }   

* gwt-console-server\WEB-INF\lib\gwt-console-server-integration-2.1.jar\org\jboss\bpm\console\server\integration\ProcessManagement.java. Added the following method.
void completeWorkItem(String workItemId, Map<String,Object> results);

* Finally I integrated all the changes into gwt-console-server\WEB-INF\classes\org\jboss\bpm\console\server\ProcessMgmtFacade.java. Added the following REST method.
@POST
    @Path("definition/{id}/ctr_component_complete")
    @Produces("application/json")
    public Response ctrComponentComplete(@PathParam("id") String definitionId,
            @FormParam("workitemID") String workItemID) {
        try {
            getProcessManagement().completeWorkItem(workItemID, null);
            return createJsonResponse("SUCCESS");
        } catch (Throwable t) {
            throw new WebApplicationException(t, 500);
        }
    }


 I deployed my changes and was SUCCESSFULLY able to verify that the jbpm-console web application state and the diagram highlighting are updating as expected.

Thanks for your help again.

-Ajay
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/631454#631454]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111012/f05df2b3/attachment-0001.html 


More information about the jboss-user mailing list