Tuesday, 21 April 2015

Create a custom In-Basket in IBM Case Manager


//Create a custom In-Basket in IBM Case Manager

//I.  Create a custom In-basket.
// II. Add custom In-basket to the particular Role 

1. Open Process Designer.
2. Edit Solution Workflow (Goto File -> Solution -> Edit..)

 


3.   After Open the workflow, Select In-basket(Goto Edit -> In-basket)


4. Select Queue for In-basket (On which Work Queue you need to create custom In-basket)

 

 5.Click on New

 


6.  Enter name of In-basket (Example: Manager)

7. Create Columns and labels and Create Filters(If you required)
 

8. In-basket created successfully
9. Add the In-basket to the particular Role(s)
10. Select Roles(Goto Edit -> Roles)
 

11. select Role and Select In-basket and Members (Here Manager In-basket)




12. select In-basket


13. Provide Authorization (add users and groups (Not necessary))


14. Save the changes (File -> FileNet -> FileNet Save..)
 
 
15. Deploy the Solution (from Case builder or Command prompt).

**************In-basket created and added to the Role**************


Tuesday, 14 April 2015

Create Work item through existing Workflow (Process Engine API)

//Create Work item through existing Workflow (Process Engine API)


public VWCreateLiveWOResult[] createLiveWorkObject( java.lang.String[] fieldNames, 
java.lang.Object[] fieldValues, 
java.lang.String workflowIdentifier, 
int numberToCreate) 
throws VWException

will creates (initializes, saves, and dispatches) work items from a transferred workflow definition, specified by its workflow identifier. Multiple work classes on one roster are supported

fieldNames - A String array containing the names of the fields to update in the new work items, in the same order that the values for those fields are supplied in the fieldValues parameter.

fieldValues - An array of Objects whose values are supplied, in order, to the fields named in the fieldNames parameter. 

workflowIdentifier - The workflow definition name (work class name) as returned by VWWorkflowDefinition.getName method, or the workflow version (version property) as returned by VWTransferResult.getVersion. You can get a VWTransferResult object using the transfer method. If a translation source exists, the authored work class name is translated.

numberToCreate - An integer for the number of work items to create. 


try {
      String[] myWorkObjectNumbers = (String[])null;
      String[] myRosterNames = (String[])null;

      VWCreateLiveWOResult[] createWORes = this.peSession
        .createLiveWorkObject(myFieldNames, myLaunchValues, myWorkflowName, 1);

      if (createWORes[0].success())
      {
        myWorkObjectNumbers = new String[createWORes.length];
        myRosterNames = new String[createWORes.length];
        for (int i = 0; i < createWORes.length; i++) {
          myWorkObjectNumbers[i] =
            createWORes[i].getWorkObjectNumber();
          log.info("New workflow with Wob Number [" +
            myWorkObjectNumbers[i] +
            "] launched successfully");
          myRosterNames[i] = createWORes[i].getRosterName();
          log.debug("Workflow Roster Name is [" + myRosterNames[i] +
            "]");
        }

      }

    }
    catch (Exception ex)
    {
      log.error("Exception occured while launching workflow:" +
        ex.getMessage(), ex);
      throw ex;
    }

  






Sunday, 12 April 2015

JavaScript for Dynamic in-basket Filter (Case Manager Scipt)

//JavaScript for Dynamic in-basket Filter based on role and In-basket. 

Script: 

var um = parent.com.ibm.mashups.enabler.model.Factory.getUserModel();                                                        
var dfr = um.findCurrentUser();                                                         
var currentUserObj = dfr.start();                                                        
var currUser = currentUserObj.getDisplayName();                                         
var currRole =  ecmwdgt.getBean("spaceConfig").getEffectiveRole();                
fmsCurrInbasket = payload.currentInbasket ;
console.log('currUser = '+currUser+"  currRole="+currRole + "  Inbasket="+payload.currentInbasket);

if (currRole=='Employee' && payload.currentInbasket=='My Work')
 {
 console.log("inside Requestor if loop "); 
    console.log("Current User" + currUser);
 var filter= {                    
    "queueName":payload.queueName,                    
    "inbasketName":payload.currentInbasket,                    
    "hideFilterUI":false,                    
    "filters":[                               
  {                    
   "name": "EmpID",                    
   "value":currUser                     
  },     
  {                    
     "name": "Pointer",                    
     "value":'2'                     
  }
    ]                    
 };                    
    console.log("inside loop: " +filter);               
    return filter;
 }
 
return payload;
   
Wiring: