Invoking Work Item Management Services using js javascript

Hi,

I have been looking for reasources on this but I could not find any. This is what I am trying to achieve:

User opens work item in open space. The following actions run:

 On form open  

1. context.form.invokeAction("close",this,context). (Form closes, state of work item = OFFERED).

2. var respons = run_JS_File_Method1_OpenURL(var1, var2...). (New java jsp form is called via url and opened with passed variables)  

var strURLBase = "https://Resource/Navigation.jspx?"&user=" + user;
winRef = window.open(strURLBase);

3. var response2 = run_JS_File_Method2_AllocateWorkItem(WorkItemId, GUID) (Work Item Management Service JAVA API OR REST SERVICE is called to allocate given work item id - state of work item = ALLOCATED)

I am trying to replicate something like this, however I did not write this code and it is for an old iProcess method:

function lock_item() {

try{

var items = new Array(oForm.workItemTag);
    var action = new com.tibco.bpm.ipc.Action([
        com.tibco.bpm.ipc.WorkQRequests.lockItems(
        oForm.getXmlCacheId(),
        oForm.workQTag,
        items,
        new com.tibco.bpm.ipc.vWIFGContent("ssoFormMarkings"))]);

    //Create an authenticated connection to the Action Processor
    var socket = oForm.getApp().newSocket(oForm.getXmlCacheId());
    socket.setAsync(false);
    socket.addParameter('action', action.toXml());

    //Execute the Action Processor request
    socket.setShowUserMsg(false);
    socket.execute();

    //Error reporting - if anything fails
    var ssoExNode = socket.getSsoExceptionNode();
    if (ssoExNode != null){
        socket.setShowUserMsg(true);
        socket.reportErrors();
    }

}

I have achieved the first two parts, I open the jsp java from and close the current work item, but I can't seem to get the work item to be allocated to the user opening the form once it is closed using scripting and NOT a work item management SOAP API call. I need to action this once the form opens, as we are using 3rd party java froms.

 

Thanks in advance for any help you may have.

Regards

 

1 Comment

OPEN WORK ITEM ---> CALL EXTERNAL JSP FORM ---> CLOSE CURRENT WORK ITEM ---> ALLOCATE WORK ITEM TO USER WHO OPENED WORK ITEM 

jdtbuchan - May 16, 2017 - 6:01am ::
+ Add a Comment

(1) Answer

Login