Friday, May 25, 2018

Thursday, May 24, 2018

OIM-SOA: Populating wftask table with custom attributes

Many a times, for reporting or other purposes, we need to populate the data the wftask table(directly mapped to human task in composite) with some custom data.
This custom data can be data from the payload or any other data that is present in the composite.

Updating the wftask table with the composite data can avoid writing bpel apis and a query suffices in this case.

How to do it, is probability what you are interested in. This is done by a simple assignment in the human task.
  1. Expand your human task in the composite. You should see a construct like 'taskName_AssignTAskAttributes'


    2. This is where you need to assign the variables. You can do it in design editor, or can copy the following lines in BPEL file.
<copy> 
      <from variable="inputVariable" part="payload" 
        query="/client:process/client:EntityKey"/> 
      <to variable="initiateTaskInput" part="payload" 
       query="/taskservice:initiateTask/task:task/task:customAttributes/task:customAttributeString1"/> 
</copy> 
<copy> 
  <from variable="inputVariable" part="payload" 
   query="/client:process/client:BeneficiaryLogin"/> 
  <to variable="initiateTaskInput" part="payload" 
   query="/taskservice:initiateTask/task:task/task:customAttributes/task:customAttributeString2"/> 
</copy>

You might want to edit the data in from and to depending on your exact requirement.

3. Now, once you deploy and test the composite. You will see the two columns 'customAttributeString1' and 'customAttributeString2' populated in your wftask table.




Wednesday, May 16, 2018

Friday, May 11, 2018

Tuesday, May 8, 2018

Java: Comma Separated String to List

    ArrayList<String> convertCommaSprtdStrToList(String commaSprtdStr) {
        ArrayList<String> list = new ArrayList<String>();
       
        if(commaSprtdStr == null || commaSprtdStr.isEmpty())
            return list;
       
        String[] strArr = commaSprtdStr.split(",");
       
        if(commaSprtdStr != null && !commaSprtdStr.isEmpty()) {
            for(String str : strArr) {
                list.add(str.trim());
            }
        }
       
        return list;
    }