OIM API - to Updating Access Policy Form Data


    package com.oimacademy.provision;
    import java.util.HashMap;
    import java.util.Map;
    import com.oimacademy.connection.Platform;
    import Thor.API.tcResultSet;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcColumnNotFoundException;
    import Thor.API.Exceptions.tcFormNotFoundException;
    import Thor.API.Exceptions.tcInvalidValueException;
    import Thor.API.Exceptions.tcNotAtomicProcessException;
    import Thor.API.Exceptions.tcProcessNotFoundException;
    import Thor.API.Exceptions.tcRequiredDataMissingException;
    import Thor.API.Operations.tcFormInstanceOperationsIntf;
    public class UpdatingAccessPolicyFormData {
     public static void main(String[] args) throws tcAPIException, tcNotAtomicProcessException, tcFormNotFoundException, tcProcessNotFoundException, tcInvalidValueException, tcRequiredDataMissingException{
       tcFormInstanceOperationsIntf formInstanceIntf = Platform.getService(tcFormInstanceOperationsIntf.class);  
       long processInstanceKey= 793L;
         tcResultSet trs = formInstanceIntf.getProcessFormData(processInstanceKey);
         int count=trs.getRowCount();
         for(int i=0;i<count;i++){
                         trs.goToRow(i);     
                 String columnNames[] = trs.getColumnNames();
                 for (String string : columnNames)
                 {
                     try {
                         System.out.println(string + " - " + trs.getStringValue(string));
                     } catch (tcAPIException | tcColumnNotFoundException e)
                    {
                         e.printStackTrace();
                     }
                 }
          }    
         // Updating the For Column.
         String adColumnName="UD_ADUSER_ZIP";
         Map updateData=new HashMap();
         updateData.put(adColumnName, "1234");
         formInstanceIntf.setProcessFormData(processInstanceKey, updateData);
     }
    }

No comments:

Post a Comment