26.3 Provisioning Web Service API

This section provides details about the Provisioning Web service methods.

All of the methods throw com.novell.soa.af.impl.soap.AdminException and java.rmi.RemoteException. To improve readability, the throws clause has been omitted from the method signatures.

26.3.1 Processes

This section provides reference information for each Processes method.

getProcessesByQuery

Used to get information about processes.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesByQuery(com.novell.soa.af.impl.soap.T_ProcessInfoQuery query, int maxRecords) 

Example

        //
       
   // Query information about processes for a user that are running and
        // have not been approved yet.
        String logic = "AND";
        T_ProcessInfoOrder order = T_ProcessInfoOrder.APPROVAL_STATUS;
        int CHOICE_SIZE = 4;
        Integer approvalStatusInteger = new Integer(ProcessConstants.PROCESSING);
        Integer processStatusInteger = new Integer(ProcessConstants.RUNNING);
        //
        // Setup the query with the above params
        T_ProcessInfoQueryChoice [] choice = new T_ProcessInfoQueryChoice[CHOICE_SIZE];
        choice[0] = new T_ProcessInfoQueryChoice();
        choice[0].setApprovalStatus(approvalStatusInteger);
        choice[1] = new T_ProcessInfoQueryChoice();
        choice[1].setProcessStatus(processStatusInteger);
        choice[2] = new T_ProcessInfoQueryChoice();
        choice[2].setRecipient(recipient);
        choice[3] = new T_ProcessInfoQueryChoice();
        choice[3].setRequestId(requestId); 

        int maxRecords = -1;
        T_ProcessInfoQuery processInfoQuery =
                new T_ProcessInfoQuery(T_Logic.fromString(logic), order, choice);
        ProcessArray processArray = stub.getProcessesByQuery(processInfoQuery, maxRecords);

getProcessesByStatus

Used to get information about processes with a specified status (for example, running processes).

Method Signature

public com.novell.soa.af.impl.soap.ProcessArray getProcessesByStatus(com.novell.soa.af.impl.soap.T_ProcessStatus status)

Example

      T_ProcessStatus processStatus = T_ProcessStatus.Running;
      //
      // Get processes by status
       ProcessArray processArray = stub.getProcessesByStatus(processStatus);
       Process [] process = processArray.getProcess();

getProcesses

Used to get information about processes, specified by processID.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcesses(java.lang.String id, long time,com.novell.soa.af.impl.soap.T_Operator op, java.lang.String initiator, java.lang.String recipient) 

Parameters

Parameter

Description

processId

The process Id (java.lang.String).

creationTime

The time at which the process was started (long).

op

The operator to use. The operators are:

  • EQ - equals
  • LT - less than
  • LE - less than or equal to
  • GT - greater than
  • GE - greater than or equal to

initiator

The initiator of the workflow.

recipient

The recipient of the approval activity.

Example

       int processMatchCount = 0;
       T_Operator operator = T_Operator.GT;
       long currentTimeInMillis = System.currentTimeMillis();
       String [] requestIds = requestIdArray.getString();
       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
String requestId = provUtils.startProvisioningRequest(provMap, null);
       sleep(5);

       Process process = stub.getProcess(requestId);
       if(process != null)
       {
            String processId = process.getProcessId();
            String initiator = process.getInitiator();

            ProcessArray processArray = stub.getProcesses(processId, currentTimeInMillis, operator, initiator, recipient);
       }

getAllProcesses

Used to get information about all running and completed provisioning requests.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getAllProcesses()

Example

    ProcessArray array = stub.getAllProcesses();
    Process [] processes = array.getProcess();
     if(_process != null)
    {
        sb = new StringBuffer();
        sb.append("\nProcess List:");
        for(int index = 0; index < _process.length; index++)
        {
            String processId = _process[index].getProcessId();
            String approvalStatus = _process[index].getApprovalStatus();
            Calendar completionTime = _process[index].getCompletionTime();
            Calendar creationTime = _process[index].getCreationTime();
            String engineId = _process[index].getEngineId();
            String proxy = _process[index].getProxy();
            String initiator = _process[index].getInitiator();
            String processName = _process[index].getProcessName();
            String processStatus = _process[index].getProcessStatus();
            String p_recipient = _process[index].getRecipient();
            String p_requestId = _process[index].getRequestId();
            int valueOfapprovalStatus = _process[index].getValueOfApprovalStatus();
            int valueOfprocessStatus = _process[index].getValueOfProcessStatus();
            String version = _process[index].getVersion();
        }

getProcessesArray

Used to limit the number of processes returned. If the limit you specify is less than the system limit, the number you specify is returned. If you exceed the system limit, the Workflow Engine returns the system limit. If the limit you specify is less than or equal to 0, the Workflow Engine returns all processes.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesArray(int maxRecords);

Example

    /**
     * Method to augment the getAllProcesses() method that impose limits
     * on the number of processes returned.
     * @throws TestProgramException
     */
    public void adding_Limits_To_getProcessArray_TestCase()
    throws TestProgramException
    {
        String recipient = ServiceUtils.getInstance().getLoginData().getUsername(LoginData.RECIPIENT_TYPE);
        String requestNameToStart = provUtils.getProvisioningResourceNameForRecipient(recipient, 
                "Enable Active Directory");
        //
        // Get the stub
        Provisioning stub = ServiceUtils.getInstance().getProvisioningStub();
        try
        {
            //
            // Start multiple requests
            final int NUMBER_OF_REQUESTS_TO_START = 2;

            Map map = MapUtils.createAndSetMap(new Object[] {
                    Helper.RECIPIENT, recipient,
                   
IProvisioningConstants.PROVISIONING_REQUEST_TO_START, requestNameToStart});
            //
            // Start request(s)
            StringArray requestIdArray = 
                provUtils.startMultipleProvisioningRequests(map, null, NUMBER_OF_REQUESTS_TO_START);
            LoggerUtils.sleep(3);
            LoggerUtils.sendToLogAndConsole("Started " + NUMBER_OF_REQUESTS_TO_START + " provisioning requests");
            //
            // New method to limit the number of processes returned
            //
            // Test Results : maxProcesses <= 0 returns all processes
            //                maxProcesses up to system limit returns maxProcess count
            //                maxProcesses > system limit returns system limit
            int maxProcesses = 10;
            ProcessArray processArray = stub.getProcessesArray(maxProcesses);
            Process [] processes = processArray.getProcess();
            if(processes != null)
            {
                LoggerUtils.sendToLogAndConsole("Process count returned: " + processes.length);
                Assert.assertEquals("Error: Processes returned shouldn't exceed max count.",
                        maxProcesses, processes.length);
            }
        }
        catch(AdminException error) 
        {
            RationalTestScript.logError(error.getReason() );
            throw new TestProgramException(error.getReason() );
        }
        catch(RemoteException error) 
        {
            RationalTestScript.logError(error.getMessage() );
            throw new TestProgramException(error.getMessage() );
        }
    }    

getProcessesById

Used to get information about a specific process, specified by the Process Id.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesById(java.lang.String id)

Example

    Process [] allProcesses = stub.getAllProcesses().getProcess();
    if(allProcesses != null)
    {
          String processId = allProcesses[0].getProcessId;
          ProcessArray array = stub.getProcessesById(processId);
          Process [] processes = array.getProcess();
     }

terminate

Used to terminate a running provisioning request.

Method Signature

void terminate(java.lang.String requestId, com.novell.soa.af.impl.soap.T_TerminationType state, java.lang.String comment) 

Parameters

Parametere

Description

requestId

The Id of the provisioning request.

state

The reason for terminating the process. The choices are:

RETRACT

ERROR

comment

Adds a comment about the terminate action.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request 
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //
     // Now retract the request
     T_TerminationType terminationType = T_TerminationType.RETRACT;
    stub.terminate(requestId, terminationType, terminationType.getValue() + " the request");

getProcess

Used to get information about a running or completed provisioning request, specified by Request ID.

Method Signature

com.novell.soa.af.impl.soap.Process getProcess(java.lang.String requestId) 

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
 
    Process process = stub.getProcess(requestId);
    if(process != null)
    {
        boolean bMatchProcess = false;
        if( (recipient.compareTo(process.getRecipient()) == 0) && (requestId.compareTo(process.getRequestId()) == 0) )
        {
            bMatchProcess = true;
        }
        if(bMatchProcess)
        {
            String msg = "Found process with requestId : " + requestId;
            LoggerUtils.sendToLogAndConsole(msg);
        }
        //
        // Assert if we could not find a match
        Assert.assertTrue("Could not find process with request id: " + requestId, bMatchProcess);
    }

getProcessesByCreationTime

Used to get information about processes created between the current time and the time at which the workflow process was created.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesByCreationTime(long time, com.novell.soa.af.impl.soap.T_Operator op)

Parameters

Parameter

Description

creationTime

The time at which the process was started.

op

The operator to use. The operators are:

  • EQ - equals
  • LT - less than
  • LE - less than or equal to
  • GT - greater than
  • GE - greater than or equal to

Example

     T_Operator operator = T_Operator.GT;
    //
    // Get processes with operator relative to the current time
    long currentTime = System.currentTimeMillis();//currentDateTime.getTime();
    ProcessArray processArray = stub.getProcessesByCreationTime(currentTime, operator);

getProcessesByApprovalStatus

Used to get information about processes with a specified approval status (Approved, Denied, or Retracted).

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesByApprovalStatus(com.novell.soa.af.impl.soap.T_ApprovalStatus status)

Example

    T_ApprovalStatus approvalStatus = T_ApprovalStatus.Approved;
    //
    // Get all the processes based upon approval status above
    ProcessArray processArray = stub.getProcessesByApprovalStatus(approvalStatus);
    Process [] processes = processArray.getProcess();

getProcessesByRecipient

Used to get information about processes that have a specific recipient Id.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesByRecipient(java.lang.String recipient) 

Example

    String recipient = "cn=ablake,ou=users,ou=idmsample-komodo,o=netiq";
    //
    // Get processes by recipient
    ProcessArray processArray = stub.getProcessesByRecipient(recipient);
    Process [] process = processArray.getProcess();

getProcessesByInitiator

Used to get information about processes that have a specific initiator Id.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesByInitiator(java.lang.String initiator)

Example

    String initiator = "cn=admin,ou=idmsample-komodo,o=netiq";

    //
    // Get processes by initiator
    ProcessArray processArray = stub.getProcessesByInitiator(initiator);
    Process [] process = processArray.getProcess();

setResult

Used to set the entitlement result (approval status) of a previously completed provisioning request.

Method Signature

void setResult(java.lang.String requestId, com.novell.soa.af.impl.soap.T_EntitlementState state, com.novell.soa.af.impl.soap.T_EntitlementStatus status, java.lang.String message)

Parameters

Parameter

Description

requestId

The Id of the provisioning request.

state

The state of the provisioning request. The possible values are:

  • Unknown
  • Granted
  • Revoked

status

The status of the provisioning request. The possible values are:

  • Unknown
  • Success
  • Warning
  • Error
  • Fatal
  • Submitted

message

A message about the entitlement result.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);

     //
     // Get the process id for this running process
     Process process = stub.getProcess(requestId);
     String processId = null;
     if (process != null)
        processId = process.getProcessId();
    //
    // Reset the state of the provisioning request
    T_EntitlementState newEntitlementState =
T_EntitlementState.Revoked;
    T_EntitlementStatus newEntitlementStatus = T_EntitlementStatus.Success;
    String comment = "Revoked the provisioning request";
    stub.setResult(processId, newEntitlementState, newEntitlementStatus, comment);
 

getProcessesByCreationInterval

Used to get information about processes started between two specified times.

Method Signature

com.novell.soa.af.impl.soap.ProcessArray getProcessesByCreationInterval(long start, long end) 

Parameters

Parameter

Description

startTime

The start time (YYYY/MM/DD).

endTime

The end time (YYYY/MM/DD).

Example

     long startTime = System.currentTimeMillis();
     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);

    long endTime = System.currentTimeMillis();
    //
    // Get all the processes between the start and end time    ProcessArray processArray = stub.getProcessesByCreationInterval(startTime, endTime);
    Process [] processes = processArray.getProcess();

26.3.2 Provisioning

This section provides reference information for each Provisioning method.

multiStart

Used to start a workflow request for each specified recipient.

Method Signature

com.novell.soa.af.impl.soap.StringArray multiStart(java.lang.String processId, com.novell.soa.af.impl.soap.StringArray recipients, com.novell.soa.af.impl.soap.DataItemArray items) 

Parameters

Parameter

Description

processId

The Id of the provisioning request to start.

recipients

The DN of each recipient.

dataItem

The list of data items for the provisioning request.

Example

     ProvisioningRequestArray requestArray = stub.getAllProvisioningRequests(recipient);

    //
    // If there are some then,
    if(requestArray != null)
    {
        String Id = " ";
        StringArray requestIdStringArray = null;
        String [] listOfRecipients = {recipient, addressee};
        //
        // Select a provisioning resource
        String requestNameToStart = "Enable Active Directory Account (Mgr Approve-No Timeout)";
        //
        // Loop thru and find the request that we want to start
        ProvisioningRequest [] requests = requestArray.getProvisioningrequest();
        for(int index = 0; index < requests.length; index++)
        {
            //
            // Is this the name of the request to start?
            if(requests[index].getName().compareTo(requestNameToStart) == 0)
            {
                //
                // Get the current associated data items. Replicate a new
                // dataitem array excluding the null values.
                Id = requests[index].getId();
                DataItem [] dataItem = requests[index].getItems().getDataitem();
                if(dataItem != null)
                // Call method replicateDataItemArray on the
                // provUtils utility object, which refers to a 
                // utility class that does not ship with the 
                // Identity Manager User Application.
                {
                    DataItemArray newDataItemArray = provUtils.replicateDataItemArray(dataItem);
                    //
                    // Create a string array initializing with multiple recipients
                    StringArray listOfRecipientsStringArray = new StringArray(listOfRecipients);
                    //
                   // Start the request for multiple recipients
                    logStep("Calling stub.multiStart(" + Id + ",listOfRecipientsStringArray,newDataItemArray)");
                    requestIdStringArray = stub.multiStart(Id, listOfRecipientsStringArray, newDataItemArray);
            }
        }
} 

start

Used to start a provisioning request.

Method Signature

java.lang.String start(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items)

Parameters

Parameter

Description

processId

The Id of the provisioning request to start.

recipient

The DN of each recipient.

dataItem

The list of data items for the provisioning request.

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap, null);
       sleep(5);

The example above calls the startProvisioningRequest method. This method is not part of the identity applications. We show it here to finish illustrating the example:

          /**
           *Method to start a provisioning request using the supplied
           *Map and dataitem object. Handling of digital certificate
           *resources is also handled.
           * @param _map
           * @param _in_dataItem
           * @return String
           * @throws TestProgrammException
           */
          public String startProvisioningRequest(Map _map, DataItem []
          _in_dataItem) throws TestProgramException
         {
            String requestId = null;
            try
            {
               String recipient  =(String)_map.get(Helper.RECIPIENT);
               String requestToStart = (String)_map.get(IProvisioningConstants.PROVISIONING_REQUEST_TO_START);
               String proxyUser  =(String)_map.get(IWorkFlowConstants.PROXY_USER);
               String digitalSignature = String)_map.get(IDigitalSignatureConstants.DIGITAL_SIGNATURE);
               RationalTestScript.logInfo("Step: Calling startProvisioningRequest(_map)");
               //
               //Get the stub
               Provisioning stub = ServiceUtils.getInstance().getProvisioningStub();
               //
       //Get all the available resource requests for the recipient
       RationalTestScript.logInfo("Step: Calling stub.getAllProvisioningRequests(" + recipient + ")");
       ProvisioningRequestArray requestArray = stub.getAllProvisioningRequests(recipient);
       if(requestArray != null)
       {
           //
           //Get the provisioning request from the array
           ProvisioningRequest request = getProvisioningRequestFromArray(requestArray, requestToStart);
           if(request != null)
       {
       DataItem [] dataItem = null;
       DataItemArray newDataItemArray = null;
       //
       // If the supplied data item is null then just replicate
       // what currently exists with the request.
       if(_in_dataItem == null)
       {
           //
           // Use the current data item associated with the request
           dataItem = request.getItems().getDataitem();
           if(dataItem != null)
           {
               newDataItemArray = replicateDataItemArray(dataItem);
           }
       }
       else
       {
           //
           // Set the incoming data item array
           newDataItemArray = new DataItemArray();
           newDataItemArray.setDataitem(_in_dataItem);
       }
       //
       // Start the Provisioning request for the recipient
       if(proxyUser == null && digitalSignature == null)
          {
              RationalTestScript.logInfo("Step: Calling stub.start(" + request.getId() + "," + recipient + "dataItemArray)");
                        requestId = stub.start(
                                request.getId(),
                                recipient,
                                newDataItemArray);
          }
           else if(proxyUser != null && digitalSignature == null)
           }
                 .
           .
          .

getAllProvisioningRequests

Used to return an array of available provisioning requests.

Method Signature

com.novell.soa.af.impl.soap.ProvisioningRequestArray  getAllProvisioningRequests(java.lang.String recipient)

Example

    //

    // Get all the provisioning requests for this recipient

    ProvisioningRequestArray provReqArray = stub.getAllProvisioningRequests(recipient);
    ProvisioningRequest [] provRequest = provReqArray.getProvisioningrequest();
    if(provRequest != null)
    {
        String description = provRequest[0].getDescription();
        String category = provRequest[0].getCategory();
        String digitialSignatureType = provRequest[0].getDigitalSignatureType();
        String requestId = provRequest[0].getId();
        DataItemArray itemArray = provRequest[0].getItems();
        String legalDisclaimer = provRequest[0].getLegalDisclaimer();
        String name = provRequest[0].getName();
        String operation = provRequest[0].getOperation();
    }

getProvisioningRequests

Used to return an array of provisioning requests for a specified category and operation.

Method Signature

com.novell.soa.af.impl.soap.ProvisioningRequestArray  getProvisioningRequests(java.lang.String recipient, java.lang.String category, java.lang.String operation) 

Parameters

Parameter

Description

recipient

The recipient of the provisioning request.

category

The category of the provisioning request.

operation

The provisioning request operation (0=Grant,1=Revoke, 2=Both)

Example

    String operation = IProvisioningRequest.GRANT;
    try
    {
        //
        // Get the stub
        Provisioning stub = ServiceUtils.getInstance().getProvisioningStub();
        logStep("Calling stub.getProvisioningCategories()");
        StringArray categoriesStringArray = stub.getProvisioningCategories();
        String [] categories = categoriesStringArray.getString();
        //
        // Loop thru and get the provisioning requests for each category
        for(int index = 0; index < categories.length; index++)
        {
            //
            // Get the provisioning request based upon recipient
            logStep("Calling stub.getProvisioningRequests(" + recipient + "," + categories[index] + "," + operation + ")");
            ProvisioningRequestArray provRequestArray = stub.getProvisioningRequests(recipient, categories[index], operation);
            ProvisioningRequest [] provRequests = provRequestArray.getProvisioningrequest();
        }

getProvisioningCategories

Used to get the list of available provisioning categories.

Method Signature

com.novell.soa.af.impl.soap.StringArray getProvisioningCategories() 

Example

       StringArray categoriesStringArray = stub.getProvisioningCategories();
       String [] categories = categoriesStringArray.getString();

startAsProxy

Used to start a workflow as a proxy.

Method Signature

java.lang.String startAsProxy(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String proxyUser)

Parameters

Parameter

Description

processId

The Id of the provisioning request.

recipient

The recipient of the provisioning request.

Items

The data items for the provisioning request.

proxyUser

The DN of the proxy user.

Example

    ProvisioningRequestArray requestArray = stub.getAllProvisioningRequests(recipient);
    //
    // If there are some then,
    if(requestArray != null)
    {
        String Id = " ";
        String requestId = " ";
        String requestNameToStart = "Enable Active Directory Account (Mgr Approve-No Timeout)";
        //
        // Loop thru and find the request that we want to start
        ProvisioningRequest [] requests = requestArray.getProvisioningrequest();
        for(int index = 0; index < requests.length; index++)
        {
            //
            // Is this the name of the request to start?
            if(requests[index].getName().compareTo(requestNameToStart) == 0)
            {
                //
                // Get the current associated data items. Replicate a new
                // dataitem array excluding the null values.
                Id = requests[index].getId();
                DataItem [] dataItem = requests[index].getItems().getDataitem();
                if(dataItem != null)
                {
                    // Call method replicateDataItemArray on the
                    // provUtils utility object, which refers to a 
                    // utility class that does not ship with the 
                    // Identity Manager User Application.
                    DataItemArray newDataItemArray = provUtils.replicateDataItemArray(dataItem);
                    //
                    // Start the Provisioning request for the recipient
                    logStep("Calling stub.startAsProxy(" + Id + "," + recipient + ",newDataItemArray," + proxyUser + ")");
                    requestId = stub.startAsProxy(Id, recipient, newDataItemArray, proxyUser);
                }
            }
        }
    }

getProvisioningStatuses

Used to get the status of provisioning requests.

Method Signature

com.novell.soa.af.impl.soap.ProvisioningStatusArray  getProvisioningStatuses(com.novell.soa.af.impl.soap.T_ProvisioningStatusQuery query, int maxRecords) 

Parameters

Parameter

Description

query

Used to specify the provisioning status query. The query has the following components:

  • choice - the parameters used to filter the results. You can specify multiple parameters. The possible parameters are:

    • Recipient - a DN
    • RequestID
    • ActivityID
    • Status (an integer)
    • State (an integer)
    • ProvisioningTime (YYYY/MM/DD)
    • ResultTime (YYYY/MM/DD)
  • logic - AND or OR

  • order - the order in which to sort the results. Possible values for order are:

    • ACTIVITY_ID
    • RECIPIENT
    • PROVISIONING_TIME
    • RESULT_TIME
    • STATE
    • STATUS
    • REQUEST_ID
    • MESSAGE

maxRecords

Used to specify maximum number of records to retrieve. A value of -1 returns unlimited records.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //
     //
    T_ProvisioningStatusQueryChoice [] choice = new T_ProvisioningStatusQueryChoice[3];
    choice[0] = new T_ProvisioningStatusQueryChoice();
    choice[0].setRecipient(recipient);
    choice[1] = new T_ProvisioningStatusQueryChoice();
    choice[1].setRequestId(requestId);
    choice[2] = new T_ProvisioningStatusQueryChoice();
    choice[2].setStatus(new Integer(ProcessConstants.PROCESSING) );
    //
    // Initialize the query
    T_ProvisioningStatusQuery query = new T_ProvisioningStatusQuery(T_Logic.AND, T_ProvisioningStatusOrder.STATUS, choice);
    //
    // Make the query
    StringBuffer sb = new StringBuffer();
    int maxRecords = -1;

    ProvisioningStatusArray provStatusArray = stub.getProvisioningStatuses(query, maxRecords);

startWithDigitalSignature

Used to start a workflow and specify that a digital signature is required.

Method Signature

java.lang.String startWithDigitalSignature(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String digitalSignature, com.novell.soa.af.impl.soap.SignaturePropertyArray digitalSignaturePropertyArray)

Parameters

Parameter

Description

processId

The request identifier.

recipient

The request recipient.

items

The data items for the provisioning request.

digital signature

The digital signature.

digitalSignaturePropertyArray.

The digital signature property map.

Example

    String recipient = ServiceUtils.getInstance().getLoginData().getUsername(LoginData.RECIPIENT_TYPE);
    //
    // Get the digital signature string for admin
    String digitalSignature = DigitalSignatureUtils.getDigitalSignatureFromFile(IDigitalSignatureConstants.ADMIN_DIGITAL_SIGNATURE_FILENAME);
 

    ProvisioningRequestArray requestArray = stub.getAllProvisioningRequests(recipient);
    //
    // If there are some then,

   if(requestArray != null)
    {
        String Id = " ";
        String requestId = " ";
        String requestNameToStart = "Enable Active Directory Account (Mgr Approve-No Timeout)";
        //
        // Loop thru and find the request that we want to start
        ProvisioningRequest [] requests = requestArray.getProvisioningrequest();
        for(int index = 0; index < requests.length; index++)
        {
            //
            // Is this the name of the request to start?
            if(requests[index].getName().compareTo(requestNameToStart) == 0)
            {
                //
                // Get the current associated data items. Replicate a new
                // dataitem array excluding the null values.
                Id = requests[index].getId();
                DataItem [] dataItem = requests[index].getItems().getDataitem();
                if(dataItem != null)
                {
                    // Call method replicateDataItemArray on the
                    // provUtils utility object, which refers to a 
                    // utility class that does not ship with the 
                    // Identity Manager User Application.
                    DataItemArray newDataItemArray = provUtils.replicateDataItemArray(dataItem);
                    //
                    // Start a digitally signed provisioning resource for the recipient
                    requestId = stub.startWithDigitalSignature(request.getId(), recipient, newDataItemArray, digitalSignature, null); // Don't get any property values (optional)
                }
            }
        }
    }

startAsProxyWithDigitalSignature

Used to start a workflow using a proxy for the initiator, and specify that a digital signature is required.

Method Signature

java.lang.String startAsProxyWithDigitalSignature(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String digitalSignature, com.novell.soa.af.impl.soap.SignaturePropertyArray digitalSignaturePropertyArray, java.lang.String proxyUser)

Parameters

Parameter

Description

processId

The request identifier.

recipient

The request recipient.

items

The data items for the provisioning request.

digital signature

The digital signature.

digitalSignaturePropertyArray.

The digital signature property map.

proxyUser

The DN of the proxy user.

Example

    //
    // Get the digital signature string for admin
    String digitalSignature = DigitalSignatureUtils.getDigitalSignatureFromFile(IDigitalSignatureConstants.ADMIN_DIGITAL_SIGNATURE_FILENAME);
 

    ProvisioningRequestArray requestArray = stub.getAllProvisioningRequests(recipient);
    //
    // If there are some then,
    if(requestArray != null)
    {
        String Id = " ";
        String requestId = " ";
        String requestNameToStart = "Enable Active Directory Account (Mgr Approve-No Timeout)";
        //
        // Loop thru and find the request that we want to start
        ProvisioningRequest [] requests = requestArray.getProvisioningrequest();
        for(int index = 0; index < requests.length; index++)
        {
            //
            // Is this the name of the request to start?
            if(requests[index].getName().compareTo(requestNameToStart) == 0)
            {
                //
                // Get the current associated data items. Replicate a new
                // dataitem array excluding the null values.
                Id = requests[index].getId();
                DataItem [] dataItem = requests[index].getItems().getDataitem();
                if(dataItem != null)
                {
                    // Call method replicateDataItemArray on the
                    // provUtils utility object, which refers to a 
                    // utility class that does not ship with the 
                    // Identity Manager User Application.
                    DataItemArray newDataItemArray = provUtils.replicateDataItemArray(dataItem);
                    //
                    // Start a digitally signed provisioning resource as  proxy for the recipient

                     requestId = stub.startAsProxyWithDigitalSignature(request.getId(), recipient, newDataItemArray, digitalSignature, null, proxyUser);
                }
            }
        }
    }

startWithCorrelationId

Used to start a workflow with a correlation ID. The correlation ID provides a way to track a set of related workflow processes. When started with this method, workflow processes can be queried and sorted by correlation ID.

Method Signature

java.lang.String startWithCorrelationId(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String signature, com.novell.soa.af.impl.soap.SignaturePropertyArray props, java.lang.String proxyUser, java.lang.String correlationId)
     throws com.novell.soa.af.impl.soap.AdminException, java.rmi.RemoteException; 

Parameters

Parameter

Description

processId

The request identifier.

recipient

The request recipient.

items

The data items for the provisioning request.

digital signature

The digital signature.

digitalSignaturePropertyArray

The digital signature property map.

proxyUser

The DN of the proxy user.

correlationID

The string that identities the correlation ID. The correlation ID cannot be longer than 32 characters.

26.3.3 Work Entries

This section provides reference information for each Work Entries method.

forward

Used to forward a task to the next activity in the workflow with the appropriate action (approve, deny, refuse).

Method Signature

void forward(java.lang.String wid, com.novell.soa.af.impl.soap.T_Action action, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String comment) 

Parameters

Parameter

Description

wid

The work Id.

action

The action to take (approve, deny, refuse).

items

The data items required by the workflow.

comment

The comment.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    String processId = null;
    if(process != null)
        processId = process.getProcessId(); 

    T_Action action = T_Action.APPROVE;

    T_Logic logic = T_Logic.AND;

    T_WorkEntryOrder workEntryOrder = T_WorkEntryOrder.REQUEST_ID;

    T_WorkEntryQueryChoice [] workEntryqueryChoice =  new T_WorkEntryQueryChoice[3];
    workEntryqueryChoice[0] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[0].setRecipient(recipient);
    workEntryqueryChoice[1] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[1].setRequestId(requestId);
    workEntryqueryChoice[2] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[2].setProcessId(processId);
    //
    // Create work entry query
    T_WorkEntryQuery query = new T_WorkEntryQuery(logic, _workEntryOrder, workEntryqueryChoice);
    //
    // Get all work entries (max records)
    WorkEntryArray workEntryArray = stub.getWorkEntries(query, -1);

    WorkEntry [] workEntry = workEntryArray.getWorkentry();

    if(workEntry != null

    {
         for(int wIndex = 0; wIndex < workEntry.length; wIndex++)
        {
            String workId = workEntry[wIndex].getId();
            //
            //
            LoggerUtils.sendToLogAndConsole("Forwarding : " + workEntry[wIndex].getActivityName() + " work id: " + workId);        
    //
           // Get the dataitem for this item of work
            DataItemArray dataItemArray = stub.getWork(workId);
            DataItem [] dataItem = dataItemArray.getDataitem();
            DataItemArray newDataItemArray = null;
            if(dataItem != null)
                // Call method replicateDataItemArray on the
                // provUtils utility object, which refers to a 
                // utility class that does not ship with the 
                // Identity Manager User Application.
                newDataItemArray = provUtils.replicateDataItemArray(dataItem);
            else
                throw new TestProgramException("DataItem is null.");
            //
            // Claim request for recipient
            String comment = _action.toString() + " this request: " + requestId + " for " + recipient;
            stub.forward(workId, _action, newDataItemArray, comment);
        }

    }

reassignWorkTask

Used to reassign a task from one user to another.

Method Signature

void reassignWorkTask(java.lang.String wid, java.lang.String addressee, java.lang.String comment)

Parameters

Parameter

Description

wid

The Id of the task.

addressee

The addressee of the task.

comment

A comment about the task.

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap, null);
       sleep(5);
      //
      // Get the process id for this running process
      Process process = stub.getProcess(requestId);
      if(process != null)
      {
            String processId = process.getProcessId();
            String initiator = process.getInitiator();
            //
            // Setup for the query
            HashMap map = new HashMap();
            map.put(Helper.REQUESTID, requestId);
            map.put(Helper.RECIPIENT, recipient);
            map.put(Helper.PROCESSID, processId);
            map.put(Helper.INITIATOR, initiator);
            WorkEntry [] workEntry = workEntryUtils.getWorkEntriesUsingQuery(map, T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);

            if(workEntry == null)
                throw new TestProgramException("Work list is empty.");
            //
            // Reassign the work entry from recipient to the addressee
            //
            // Should only be one item
            String reassignComment = null;
            String workId = workEntry[0].getId();
            if(workId != null)
            {
                //
                // Reassign work entry(s) to addressee
                reassignComment = "Reassigning work entry " + workId + " from " + recipient + " to " + addressee;
                stub.reassign(workId, addressee, reassignComment);
                LoggerUtils.sendToLogAndConsole("Reassign work entry " + workId + " from " + recipient + " to " + addressee);
            }
    }

getWork

Used to retrieve data items for a work entry identified by the Id (UUID) of a task.

Method Signature

com.novell.soa.af.impl.soap.DataItemArray getWork(java.lang.String workId)

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap, null);
       sleep(5);
       //
       // Get the process id for this running process
      Process process = stub.getProcess(requestId);
      if(process != null)
      {
            String processId = process.getProcessId();
            String initiator = process.getInitiator();
            //
            // Setup for the query
            HashMap map = new HashMap();
            map.put(Helper.REQUESTID, requestId);
            map.put(Helper.RECIPIENT, recipient);
            map.put(Helper.PROCESSID, processId);
            map.put(Helper.INITIATOR, initiator);
            WorkEntry [] workEntry = workEntryUtils.getWorkEntriesUsingQuery(map, T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);
            //
            // Do assertion here
            Assert.assertNotNull("WorkEntry is null for recipient : " + recipient + " with request id : " + requestId, workEntry);
            DataItemArray dataItemArray = stub.getWork(workEntry[0].getId() );
            DataItem [] dataItem = dataItemArray.getDataitem();
            if(dataItem != null)
                LoggerUtils.sendToLogAndConsole(dataItem[0].getName());
      }

forwardWithDigitalSignature

Used to forward a provisioning request with a digital signature and optional digital signature properties. For example, this can be used by an administrator to force a user-facing activity to be approved, denied or refused.

Method Signature

void forwardWithDigitalSignature(java.lang.String wid, com.novell.soa.af.impl.soap.T_Action action, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String comment, java.lang.String digitalSignature, com.novell.soa.af.impl.soap.SignaturePropertyArray digitalSignaturePropertyArray) 

Parameters

Parameter

Description

wid

The workId.

action

The action to take (approve, deny, refuse).

items

The data items required by the workflow.

comment

A comment about the action.

digitalSignature

The digital signature.

digitalSignaturePropertyArray

The digital signature property map.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    String processId = null;
    if(process != null)
        processId = process.getProcessId(); 

    T_Action action = T_Action.APPROVE;

    T_Logic logic = T_Logic.AND;

    T_WorkEntryOrder workEntryOrder = T_WorkEntryOrder.REQUEST_ID;

 
 // Get the digital signature string for admin
 String digitalSignature = DigitalSignatureUtils.getDigitalSignatureFromFile(IDigitalSignatureConstants.ADMIN_DIGITAL_SIGNATURE_FILENAME);

    T_WorkEntryQueryChoice [] workEntryqueryChoice =  new T_WorkEntryQueryChoice[3];
    workEntryqueryChoice[0] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[0].setRecipient(recipient);
    workEntryqueryChoice[1] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[1].setRequestId(requestId);
    workEntryqueryChoice[2] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[2].setProcessId(processId);
    //
    // Create work entry query
    T_WorkEntryQuery query = new T_WorkEntryQuery(logic, _workEntryOrder, workEntryqueryChoice);
    //
    // Get all work entries (max records)
    WorkEntryArray workEntryArray = stub.getWorkEntries(query, -1);

    WorkEntry [] workEntry = workEntryArray.getWorkentry();

    if(workEntry != null

    {
         for(int wIndex = 0; wIndex < workEntry.length; wIndex++)
        {
            String workId = workEntry[wIndex].getId();
            //
            //
            LoggerUtils.sendToLogAndConsole("Forwarding : " + workEntry[wIndex].getActivityName() + " work id: " + workId);
            //
            // Get the dataitem for this item of work
            DataItemArray dataItemArray = stub.getWork(workId);
            DataItem [] dataItem = dataItemArray.getDataitem();
            DataItemArray newDataItemArray = null;
            if(dataItem != null)
                  // Call method replicateDataItemArray on the
                  // provUtils utility object, which refers to a 
                  // utility class that does not ship with the 
                  // Identity Manager User Application.
                newDataItemArray = provUtils.replicateDataItemArray(dataItem);
            else
                throw new TestProgramException("DataItem is null.");
            //
            // Claim request for recipient
            String comment = _action.toString() + " this request: " + requestId + " for " + recipient;
            stub.forwardWithDigitalSignature(workId, _action, newDataItemArray, comment, digitalSignature, null);
  }

    }

forwardAsProxy

Used to forward a provisioning request. For example, this can be used by an administrator to force a user-facing activity to be approved, denied or refused.

Method Signature

void forwardAsProxy(java.lang.String wid, com.novell.soa.af.impl.soap.T_Action action, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String comment, java.lang.String proxyUser) 

Parameters

Parameter

Description

wid

The workId (activity Id).

action

The action to take (approve, deny, refuse).

items

The data items required by the workflow.

comment

The comment to add to the activity.

proxyUser

The DN of the proxy user.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not  
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    String processId = null;
    if(process != null)
        processId = process.getProcessId(); 

    T_Action action = T_Action.APPROVE;

    T_Logic logic = T_Logic.AND;

    T_WorkEntryOrder workEntryOrder = T_WorkEntryOrder.REQUEST_ID;
 

    T_WorkEntryQueryChoice [] workEntryqueryChoice =  new T_WorkEntryQueryChoice[3];
    workEntryqueryChoice[0] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[0].setRecipient(recipient);
    workEntryqueryChoice[1] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[1].setRequestId(requestId);
    workEntryqueryChoice[2] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[2].setProcessId(processId);
    //
    //  work entry query
    T_WorkEntryQuery query = new T_WorkEntryQuery(logic, _workEntryOrder, workEntryqueryChoice);
    //
    // Get all work entries (max records)
    WorkEntryArray workEntryArray = stub.getWorkEntries(query, -1);

    WorkEntry [] workEntry = workEntryArray.getWorkentry();

    if(workEntry != null

    {
         for(int wIndex = 0; wIndex < workEntry.length; wIndex++)
        {
            String workId = workEntry[wIndex].getId();
            //
            //
            LoggerUtils.sendToLogAndConsole("Forwarding : " + workEntry[wIndex].getActivityName() + " work id: " + workId);
            //
            // Get the dataitem for this item of work
            DataItemArray dataItemArray = stub.getWork(workId);
            DataItem [] dataItem = dataItemArray.getDataitem();
            DataItemArray newDataItemArray = null;
            if(dataItem != null)
                // Call method replicateDataItemArray on the
                // provUtils utility object, which refers to a 
                // utility class that does not ship with the 
                // Identity Manager User Application.
                newDataItemArray = provUtils.replicateDataItemArray(dataItem);
            else
                throw new TestProgramException("DataItem is null.");
            //
            // Claim request for recipient
            String comment = _action.toString() + " this request: " + requestId + " for " + recipient;
            String proxyUser = ServiceUtils.getInstance().getLoginData().getUsername(LoginData.PROXY_TYPE);
            stub.forwardAsProxy(workId, _action, newDataItemArray, comment, proxyUser);        }

    }

unclaim

Used to unclaim a provisioning request. This method only works if the request was claimed in the identity applications. You cannot unclaim a request once it has been forwarded using the SOAP interface, because the forward API method (see forward) claims and forwards in one operation.

Method Signature

void unclaim(java.lang.String wid, java.lang.String comment) 

Parameters

Parameter

Description

workId

The Id of the activity to unclaim.

comment

A comment about the action.

Example

    // Action and Approval Types
    final int SELECTED_ACTION = 0; final int CLAIMED_SELECTED_ACTION = 0;
    T_Action [] action = {T_Action.APPROVE, T_Action.REFUSE, T_Action.DENY};
    T_ApprovalStatus [] claimedAction = {T_ApprovalStatus.Approved, T_ApprovalStatus.Retracted, T_ApprovalStatus.Denied};
    //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    String processId = null;
    if(process != null)
        processId = process.getProcessId();

    HashMap map = new HashMap();
    map.put(Helper.REQUESTID, requestId);
    map.put(Helper.RECIPIENT, recipient);
    map.put(Helper.PROCESSID, processId);
    //
    // Claim the request
    WorkEntry workEntry = workEntryUtils.claimWorkEntry(map, action[SELECTED_ACTION]);
    if(workEntry != null)
    {
        //
        // Now unclaim the entry
        String workId = workEntry.getId();
        stub.unclaim(workId, "Unclaiming this work item : " + workId + " for request id : " + requestId);
   }

forwardAsProxyWithDigitalSignature

Used to forward a provisioning request with a digital signature and digital signature properties. For example, this can be used by an administrator to force a user-facing activity to be approved, denied or refused.

Method Signature

void forwardAsProxyWithDigitalSignature(java.lang.String wid, com.novell.soa.af.impl.soap.T_Action action, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String comment, java.lang.String digitalSignature, com.novell.soa.af.impl.soap.SignaturePropertyArray digitalSignaturePropertyArray, java.lang.String proxyUser) 

Parameters

Parameter

Description

wid

The workId (activity Id).

action

The action to take (approve, deny, refuse).

items

The data items required by the workflow.

comment

The comment to add to the activity.

digitalSignature

The digital signature.

digitalSignaturePropertyArray

The digital signature property map.

proxyUser

The DN of the proxy user.

Example

     //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    String processId = null;
    if(process != null)
        processId = process.getProcessId();
 

    T_Action action = T_Action.APPROVE;

    T_Logic logic = T_Logic.AND;

    T_WorkEntryOrder workEntryOrder = T_WorkEntryOrder.REQUEST_ID; 

    T_WorkEntryQueryChoice [] workEntryqueryChoice =  new T_WorkEntryQueryChoice[3];
    workEntryqueryChoice[0] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[0].setRecipient(recipient);
    workEntryqueryChoice[1] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[1].setRequestId(requestId);
    workEntryqueryChoice[2] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[2].setProcessId(processId);
    //
    //  work entry query
    T_WorkEntryQuery query = new T_WorkEntryQuery(logic, _workEntryOrder, workEntryqueryChoice);
    //
    // Get all work entries (max records)
    WorkEntryArray workEntryArray = stub.getWorkEntries(query, -1);

    WorkEntry [] workEntry = workEntryArray.getWorkentry();

    if(workEntry != null

    {
         for(int wIndex = 0; wIndex < workEntry.length; wIndex++)
        {
            String workId = workEntry[wIndex].getId();
            //
            //
            LoggerUtils.sendToLogAndConsole("Forwarding : " + workEntry[wIndex].getActivityName() + " work id: " + workId);
            //
            // Get the dataitem for this item of work
            DataItemArray dataItemArray = stub.getWork(workId);
            DataItem [] dataItem = dataItemArray.getDataitem();
            DataItemArray newDataItemArray = null;
            if(dataItem != null)
                // Call method replicateDataItemArray on the
                // provUtils utility object, which refers to a 
                // utility class that does not ship with the 
                // Identity Manager User Application.
                newDataItemArray = provUtils.replicateDataItemArray(dataItem);
            else
                throw new TestProgramException("DataItem is null.");
            //
            // Claim request for recipient
            String comment = _action.toString() + " this request: " + requestId + " for " + recipient;
            String digitalSignature = DigitalSignatureUtils.getDigitalSignatureFromFile(IDigitalSignatureConstants.MMACKENZIE_DIGITAL_SIGNATURE_FILENAME);
            String proxyUser = ServiceUtils.getInstance().getLoginData().getUsername(LoginData.PROXY_TYPE);
 
            stub.forwardAsProxyWithDigitalSignature(workId, _action, newDataItemArray, comment, digitalSignature, null, proxyUser);
        }

    }

reassign

Used to reassign a task from one user to another.

Method Signature

void reassign(java.lang.String wid, java.lang.String addressee, java.lang.String comment) 

Parameters

Parameter

Description

wid

The Id of the activity to be reassigned.

addressee

The addressee of the activity.

comment

A comment about the action.

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap, null);
       sleep(5);
       //
      // Get the process id for this running process
      Process process = stub.getProcess(requestId);
      if(process != null)
      {
            String processId = process.getProcessId();
            String initiator = process.getInitiator();
            //
            // Setup for the query
            HashMap map = new HashMap();
            map.put(Helper.REQUESTID, requestId);
            map.put(Helper.RECIPIENT, recipient);
            map.put(Helper.PROCESSID, processId);
            map.put(Helper.INITIATOR, initiator);
            WorkEntry [] workEntry = workEntryUtils.getWorkEntriesUsingQuery(map, T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);

            if(workEntry == null)
                throw new TestProgramException("Work list is empty.");
            //
            // Reassign the work entry from recipient to the addressee
            //
            // Should only be one work item
            String reassignComment = null;
            String workId = workEntry[0].getId();
            if(workId != null)
            {
                //
                // Reassign work entry(s) to addressee
                reassignComment = "Reassigning work entry " + workId + " from " + recipient + " to " + addressee;
                stub.reassign(workId, addressee, reassignComment);
                LoggerUtils.sendToLogAndConsole("Reassign work entry " + workId + " from " + recipient + " to " + addressee);
            }
    }

getWorkEntries

Used to query the work entries (activities) and returns a list of WorkEntry objects that satisfy the query.

Method Signature

com.novell.soa.af.impl.soap.WorkEntryArray  getWorkEntries(com.novell.soa.af.impl.soap.T_WorkEntryQuery query, int maxRecords)

Parameters

Parameter

Description

query

Used to specify the query used to retrieve the list of activities. The query has the following components:

  • choice - the parameters used to filter the results. You can specify multiple parameters. The possible parameters are:

    • Addressee - Possible values for this parameter are a DN or self. Use self if you want to retrieve work entries for the caller of the query, as identified by the authentication header of the SOAP header.
    • ProcessId
    • RequestId
    • ActivityId
    • Status (an integer)
    • Owner
    • Priority
    • CreationTime (YYYY/MM/DD)
    • ExpTime (YYYY/MM/DD)
    • CompletionTime (YYYY/MM/DD)
    • Recipient
    • Initiator
    • ProxyFor
  • logic - AND or OR

  • order - the order in which to sort the results. Possible values for order are:

    • ACTIVITY_ID
    • RECIPIENT
    • PROVISIONING_TIME
    • RESULT_TIME
    • STATE
    • STATUS
    • REQUEST_ID
    • MESSAGE

maxRecords

Used to specify maximum number of records to retrieve. A value of -1 returns unlimited records.

Example

    T_Action action = T_Action.APPROVE;

    T_Logic logic = T_Logic.AND;

    T_WorkEntryOrder workEntryOrder = T_WorkEntryOrder.REQUEST_ID; 

    T_WorkEntryQueryChoice [] workEntryqueryChoice =  new T_WorkEntryQueryChoice[3];
    workEntryqueryChoice[0] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[0].setRecipient(recipient);
    workEntryqueryChoice[1] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[1].setRequestId(requestId);
    workEntryqueryChoice[2] = new T_WorkEntryQueryChoice();
    workEntryqueryChoice[2].setProcessId(processId);
    //
    //  work entry query
    T_WorkEntryQuery query = new T_WorkEntryQuery(logic, _workEntryOrder, workEntryqueryChoice);
    //
    // Get all work entries (max records)
    WorkEntryArray workEntryArray = stub.getWorkEntries(query, -1);

    WorkEntry [] workEntry = workEntryArray.getWorkentry();

getQuorumForWorkTask

Used to get information about the quorum for a workflow activity. A quorum must have actually been specified for the workflow activity by the workflow designer for this method to work.

Method Signature

com.novell.soa.af.impl.soap.Quorum getQuorumForWorkTask((java.lang.String workId) 

Example

     //

     // Note: Provisioning resource must contain a quorum in the flow for this api method to work

    //
    // Action and Approval Types
    final int SELECTED_ACTION = 0; final int CLAIMED_SELECTED_ACTION = 0;
    T_Action [] action = {T_Action.APPROVE, T_Action.REFUSE, T_Action.DENY};
    T_ApprovalStatus [] claimedAction = {T_ApprovalStatus.Approved, T_ApprovalStatus.Retracted, T_ApprovalStatus.Denied};
    //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    String processId = null;
    if(process != null)
        processId = process.getProcessId();
    //
    // Setup for the query
    HashMap map = new HashMap();
    map.put(Helper.REQUESTID, requestId);
    map.put(Helper.RECIPIENT, recipient);
    map.put(Helper.PROCESSID, processId);
    map.put(Helper.INITIATOR, process.getInitiator() );
    WorkEntry [] workEntry =
workEntryUtils.getWorkEntriesUsingQuery(map,
T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);

    Assert.assertNotNull("WorkEntry is null for recipient : " +
recipient + " with request id : " + requestId, workEntry);
    //
    //
    String workId = workEntry[0].getId();

    Quorum quorum = stub.getQuorumForWorkTask(workId);

    Assert.assertNotNull("Quorum for work task is null for recipient :
" + recipient + " with request id : " + requestId, quorum);
    //

    // Extract some data  
    int approvalCondition = quorum.getApprovalCondition();
    int status = quorum.getStatus();
    int approveCount = quorum.getApproveCount();
    int participantCount = quorum.getParticipantCount();
    int refuseCount = quorum.getRefuseCount();

resetPriorityForWorkTask

Used to reset the priority for a task. You should only use this method on provisioning requests that have a single approval branch.

Method Signature

void resetPriorityForWorkTask(java.lang.String workId, int priority, java.lang.String comment) 

Parameters

Parameter

Description

workId

The Id of the activity.

priority

The priority to set for the activity.

comment

A comment about the action.

Example

// Calls method getProvisioningResourceNameForRecipient 
// on the provUtils utility object, which refers to a utility class 
// that does not ship with the Identity Manager User Application.
String requestNameToStart =
provUtils.getProvisioningResourceNameForRecipient(recipient, "Enable
Active Directory Account");
    Map map = MapUtils.createAndSetMap(new Object[] {
            Helper.RECIPIENT, recipient,
            IProvisioningConstants.PROVISIONING_REQUEST_TO_START,
requestNameToStart});
    //
    // Try and start the provisioning request
     String requestId =
provWrapper.startProvisioningRequest(recipient, requestNameToStart);
    RationalTestScript.sleep(5);
    //
    // Get the process id for this running process
    Process process = stub.getProcess(requestId);
    if(process != null)
    {
        //
        // Setup for the query
        HashMap map = new HashMap();
        map.put(Helper.REQUESTID, requestId);
        map.put(Helper.RECIPIENT, recipient);
        map.put(Helper.PROCESSID, process.getProcessId());
        map.put(Helper.INITIATOR, process.getInitiator());
        WorkEntry [] workEntry =
workEntryUtils.getWorkEntriesUsingQuery(map,
T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);
        //
        // Now reset the priority for this work item.
        String workId = workEntry[0].getId();
        String comment = "Resetting priority for this work item.";
        int priority = 0;
        stub.resetPriorityForWorkTask(workId, priority, comment);
}

26.3.4 Comments

This section provides reference information for each Comments method.

getCommentsByType

Used to get workflow comments that are of a specific type (for example, user, system).

Method Signature

com.novell.soa.af.impl.soap.CommentArray getCommentsByType(java.lang.String requestId, com.novell.soa.af.impl.soap.T_CommentType type) 

Parameters

Parameter

Description

requestId

The process identifier.

type

The comment type (USER or SYSTEM)

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable
Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap,
null);
      sleep(5);
      //
      // Get the comments by type : either User or System
      T_CommentType [] commentTypes = {T_CommentType.User,
T_CommentType.System};

     for(int types = 0; types < commentTypes.length; types++)
    {
        CommentArray commentArray = stub.getCommentsByType(requestId,
commentTypes[types]);
        Comment [] comments = commentArray.getComment();
        if(comments != null)
        {
            for(int index = 0; index < comments.length; index++)
            {
                LoggerUtils.sendToLogAndConsole(" \nComment Type = " +
commentTypes[types].getValue() + "\n" +
                            "Activity Id: " +
comments[index].getActivityId() + "\n" +
                            "Comment : " + comments[index].getComment()
+ "\n" +
                            "User : " + comments[index].getUser() + "\n"
+
                            "System comment : " +
comments[index].getSystemComment() + "\n" +
                            "Time stamp : " +
comments[index].getTimestamp().getTime().toString() );
           }
        }
    }

getCommentsByActivity

Used to get the comments for a specific activity.

Method Signature

com.novell.soa.af.impl.soap.CommentArray getCommentsByActivity(java.lang.String requestId, java.lang.String aid) 

Parameters

Parameter

Description

requestId

The process identifier.

aid

The activity identifier.

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable
Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap,
null);
      sleep(5);
      //
      // Get the process id for this running process
      Process process = stub.getProcess(requestId);
      if(process != null)
      {
            String processId = process.getProcessId();
            String initiator = process.getInitiator();
            //
            // Setup for the query
            HashMap map = new HashMap();
            map.put(Helper.REQUESTID, requestId);
            map.put(Helper.RECIPIENT, recipient);
            map.put(Helper.PROCESSID, processId);
            map.put(Helper.INITIATOR, initiator);
            WorkEntry [] workEntry =
workEntryUtils.getWorkEntriesUsingQuery(map,
T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);
            //
            // Get the activity id associated with the item of work
            String activityId = workEntry[0].getActivityId();
            //
            // Get the comments based on activity
            if(activityId != null)
            {
                CommentArray commentArray =
stub.getCommentsByActivity(requestId, activityId);
                Comment [] comments = commentArray.getComment();
            }

    }

getCommentsByUser

Used to get the comments made by a specific user.

Method Signature

com.novell.soa.af.impl.soap.CommentArray getCommentsByUser(java.lang.String requestId, java.lang.String user)

Parameters

Parameter

Description

requestId

The process identifier.

user

The the DN of the user (recipient) who created the comments

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable
Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap,\
null);
      sleep(5);
     //
      // Get the comments by recipient (should be the same as user)
      CommentArray commentArray = stub.getCommentsByUser(requestId,
recipient);
      Comment [] comments = commentArray.getComment();

getCommentsByCreationTime

Used to get comments made at a specific time.

Method Signature

com.novell.soa.af.impl.soap.CommentArray getCommentsByCreationTime(java.lang.String requestId, long time, com.novell.soa.af.impl.soap.T_Operator op) 

Parameters

Parameter

Description

requestId

The process identifier.

time

The time stamp.

op

The query operator to use. Possible values for operator are:

  • EQ - equals
  • LT - less than
  • LE - less than or equal to
  • GT - greater than
  • GE - greater than or equal to

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable
Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap,
null);
      sleep(5);
      //
      // Get comments by creation time for the provisioning request
started above.
      long currentTime = System.currentTimeMillis();
      LoggerUtils.sendToLogAndConsole("-->Current date = " + new
java.util.Date(currentTime).toString() );
      //
      //
      T_Operator operator = T_Operator.GT;
      CommentArray commentArray =
stub.getCommentsByCreationTime(requestId, currentTime, operator);
      Comment [] comments = commentArray.getComment();
 

addComment

Used to add a comment to a workflow activity.

Method Signature

void addComment(java.lang.String workId, java.lang.String comment)

Parameters

Parameter

Description

workId

The activity identifier (UUID).

comment

A comment about the activity.

Example

       //
       // Initialize and start a provisioning request
       HashMap provMap = new HashMap();
       provMap.put(Helper.RECIPIENT, recipient);
       provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active Directory Account (Mgr Approve-No Timeout)");
       //
       // Start request
       // Calls method startProvisioningRequest on the provUtils
       // utility object which refers to a utility class that does not
       // ship with the Identity Manager User Application.
       String requestId = provUtils.startProvisioningRequest(provMap, null);
      sleep(5);
      //
      // Setup for the query
      HashMap map = new HashMap();
      map.put(Helper.REQUESTID, requestId);
      map.put(Helper.RECIPIENT, recipient);
      WorkEntry [] workEntry = workEntryUtils.getWorkEntriesUsingQuery(map, T_WorkEntryOrder.REQUEST_ID, T_Logic.AND);
      //
      // Add comment to the work entry
      String workId = workEntry[0].getId();
      String processId = workEntry[0].getProcessId();
      String addComment = "Test comment for work id " + workId;
      stub.addComment(workId, addComment);
      sleep(2);

getComments

Used to get comments from a workflow.

Method Signature

com.novell.soa.af.impl.soap.CommentArray getComments(java.lang.String workId, int maxRecords) 

Parameters

Parameter

Description

workId

The activity Id (UUID).

maxRecords

An integer specifying the maximum number of records to retrieve.

Example

      //
      // Setup for the query
      HashMap map = new HashMap();
      map.put(Helper.RECIPIENT, addressee);
      WorkEntry [] workEntry =
workEntryUtils.getWorkEntriesUsingQuery(map,
T_WorkEntryOrder.ADDRESSEE, T_Logic.OR);
      //
      // Get all the comment records for this workId
      int maxRecords = -1;
      CommentArray commentArray = stub.getComments(workId, maxRecords);
      Comment [] comment = commentArray.getComment();

26.3.5 Configuration

This section provides reference information for each Configuration method.

setCompletedProcessTimeout

Used to set the timeout for completed processes. Processes that were completed more than timeout days ago are removed from the system. The default value is 120 days. The valid range is 0 days to 365 days.

Method Signature

void setCompletedProcessTimeout(int time) 

Example

accessConfigurationSettings(SET_COMPLETED_PROCESS_TIMEOUT, new Integer(212) );

setEngineConfiguration

Used to set workflow engine configuration parameters.

Method Signature

void  setEngineConfiguration(com.novell.soa.af.impl.soap.Configuration config) 

Parameters

Parameter

Description

minPoolSize

The minumum thread pool size.

maxnPoolSize

The maximum thread pool size.

initialPoolSize

The initial thread pool size.

keepAliveTime

Thread pool keep live time.

pendingInterval

The cluster synchronization time.

cleanupInterval

The interval between purging processes from databases.

retryQueueInterval

The interval between retrying failed processes.

maxShutdownTime

The maximum time to let threads complete work before engine shutdown.

userActivityTimeout

The default user activity timeout.

completedProcessTimeout

The default completed process timeout.

webServiceActivityTimeout

The default Web service activity timeout.

emailNotification

Turns email notification on or off.

processCacheInitialCapacity

The process cache initial capacity.

processCacheMaxCapacity

The process cache maximum capacity.

processCacheLoadFactor

The process cache load factor.

heartbeatInterval

The heartbeat interval.

heartbeatFactor

The heartbeat factor.

Example

accessConfigurationSettings(SET_ENGINE_CONFIGURATION, new Integer(313) );

getCompletedProcessTimeout

Used to get the timeout for completed processes.

Method Signature

int getCompletedProcessTimeout()

Example

accessConfigurationSettings(GET_COMPLETED_PROCESS_TIMEOUT, new Integer(121) );

setEmailNotifications

Used to globally enable or disable email notifications.

Method Signature

void setEmailNotifications(boolean enable)

Parameters

Parameter

Description

enable

Email notifications are enabled if true; otherwise they are disabled.

Example

accessConfigurationSettings(SET_EMAIL_NOTIFICATIONS, new Boolean(false) );

clearNIMCaches

Clear the NetIQ Integration Manager (previously named exteNd Composer) caches.

Method Signature

void clearNIMCaches()

Example

accessConfigurationSettings(CLEAR_NIM_CACHES, new Object() );

setWebServiceActivityTimeout

Used to set the timeout for Web service activities. The default value is 50 minutes. The valid range is 1 minute to 7 days.

Method Signature

void setWebServiceActivityTimeout(int time)

Parameters

Parameter

Description

time

The timeout value in minutes.

Example

accessConfigurationSettings(SET_WEBSERVICE_ACTIVITY_TIMEOUT, new Integer(767) );

getUserActivityTimeout

Used to get the timeout for user-facing activities.

Method Signature

int getUserActivityTimeout()

Example

accessConfigurationSettings(GET_USER_ACTIVITY_TIMEOUT, new Integer(3767) );

getEmailNotifications

Used to determine if global email notifications are enabled or disabled.

Method Signature

boolean getEmailNotifications() 

Example

accessConfigurationSettings(GET_EMAIL_NOTIFICATIONS, new Boolean(true) );

setUserActivityTimeout

Used to set the timeout for user-facing activities. The default value is no timeout (a value of zero). The valid range is 1 hour to 365 days.

Method Signature

void setUserActivityTimeout(int time)

Parameters

Parameter

Description

time

The timeout value in hours.

Example

accessConfigurationSettings(SET_USER_ACTIVITY_TIMEOUT, new Integer(1767) );

getEngineConfiguration

Used to get the workflow engine configuration parameters.

Method Signature

com.novell.soa.af.impl.soap.Configuration getEngineConfiguration()

Example

accessConfigurationSettings(GET_ENGINE_CONFIGURATION, new Integer(141) );

getWebServiceActivityTimeout

Used to get the timeout for Web service activities.

Method Signature

int getWebServiceActivityTimeout()

Example

accessConfigurationSettings(GET_WEBSERVICE_ACTIVITY_TIMEOUT, new Integer(808) );

26.3.6 Miscellaneous

This section provides reference information for each Miscellaneous method.

getGraph

Used to get a JPG image of the workflow. The Graphviz program must be installed on the computer where the application server and the identity applications is running. For more information about Graphviz, see Graphviz.

Method Signature

byte[] getGraph(java.lang.String processId)

Parameters

Parameters

Description

processId

The request Id.

Example

 //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active
Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap,
null);
     sleep(5);
     //

     //

     Process process = stub.getProcess(requestId);
     if(process != null)
    {
        byte [] graph = null;
        if( (recipient.compareTo(process.getRecipient()) == 0) &&
(requestId.compareTo(process.getRequestId()) == 0) )
        {
            graph = stub.getGraph(process.getProcessId() );
        }
        //
        // Do assert
        Assert.assertNotNull("Graph is null.", graph);
    }

getFlowDefinition

Used to get the XML for a provisioning request.

Method Signature

java.lang.String getFlowDefinition(java.lang.String processId) 

Parameters

Parameters

Description

processId

The request Id.

Example

 //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active
Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //

     //

     Process process = stub.getProcess(requestId);
     if(process != null)
    {
        String XMLFlowDefinition = null;
        if( (recipient.compareTo(process.getRecipient()) == 0) &&
(requestId.compareTo(process.getRequestId()) == 0) )
        {
            XMLFlowDefinition = stub.getFlowDefinition(process.getProcessId() );
        }
        //
        // Do assert
        Assert.assertNotNull("Flow Definition is null.", XMLFlowDefinition);
    }

getFormDefinition

Used to get the XML for a form for a provisioning request.

Method Signature

java.lang.String getFormDefinition(java.lang.String processId)

Parameters

Parameters

Description

processId

The request Id.

Example

 //
     // Initialize and start a provisioning request
     HashMap provMap = new HashMap();
     provMap.put(Helper.RECIPIENT, recipient);
     provMap.put(I"Provisioning_Request_To_Start_Key", "Enable Active
Directory Account (Mgr Approve-No Timeout)");
     //
     // Start request
     // Calls method startProvisioningRequest on the provUtils
     // utility object which refers to a utility class that does not
     // ship with the Identity Manager User Application.
     String requestId = provUtils.startProvisioningRequest(provMap, null);
     sleep(5);
     //

     //

     Process process = stub.getProcess(requestId);
     if(process != null)
    {

         String XMLFormDefinition = null;
         if( (recipient.compareTo(process.getRecipient()) == 0) &&
(requestId.compareTo(process.getRequestId()) == 0) )
        {
            XMLFormDefinition =
stub.getFormDefinition(process.getProcessId() );
        }
        //
        // Do assert
        Assert.assertNotNull("Form Definition is null.",
XMLFormDefinition);
    }

getVersion

Used to get the version of the workflow system.

Method Signature

com.novell.soa.af.impl.soap.T_Version getVersion()

Example

 StringBuffer result = new StringBuffer();

     T_Version version = stub.getVersion();
     if (version != null)
    {
        result.append(" Major = " + version.getMajor() );
        result.append(" Minor = " + version.getMinor() );
        result.append(" Revision = " + version.getRevision() );

        System.out.println("Version Information " + result.toString());
    }

26.3.7 Cluster

This section provides reference information for each Cluster method.

getEngineState

Used to get the IEngineState for a workflow engine, specified by engine Id.

Method Signature

com.novell.soa.af.impl.soap.EngineState getEngineState(java.lang.String engineId)

Parameters

Parameter

Description

engineId

The Id of the workfow engine.

Example

 EngineStateArray engineStateArray = stub.getClusterState();
    EngineState [] engineState = engineStateArray.getEngineStates();
    if(engineState != null)
    {
        LoggerUtils.sendToLogAndConsole("EngineCount in cluster:" +
engineState.length);
        for(int index = 0; index < engineState.length; index++)
        {
            EngineState engine =
stub.getEngineState(engineState[index].getEngineId() );
            LoggerUtils.sendToLogAndConsole(
                "Engine Id: " + engine.getEngineId() + "\n" +
                "Engine status: " + engine.getEngineStatus() + "\n" +
                "Value of engine status: " +
engine.getValueOfEngineStatus() + "\n" +
                "Heartbeat: " + ( (engine.getHeartbeat() != null) ?
engine.getHeartbeat().getTime().toString() : "null") + "\n" +
                "Shutdown time: " + ((engine.getShutdownTime()!= null)
? engine.getShutdownTime().getTime().toString() : "null") + "\n" +
                "Start time: " + ((engine.getStartTime() != null) ?
engine.getStartTime().getTime().toString() : "null") );
        }
    } 

reassignAllProcesses

Used to reassign all processes from the source engine to a list of target engines.

Method Signature

int reassignAllProcesses(java.lang.String sourceEngineId, com.novell.soa.af.impl.soap.StringArray targetEngineIds) 

Parameters

Parameter

Description

sourceEngineId

The Id of the source workflow engine.

targetEngineIds

The Ids of the target workflow engines.

getEngineState

Used to get a list that contains an IEngineState object for each engine in the cluster.

Method Signature

public com.novell.soa.af.impl.soap.EngineState getEngineState(java.lang.String engineId)

Parameters

Parameter

Description

engineId

The Id of the workfow engine.

Example

 EngineStateArray engineStateArray = stub.getClusterState();
    EngineState [] engineState = engineStateArray.getEngineStates();
    if(engineState != null)
    {
        LoggerUtils.sendToLogAndConsole("EngineCount in cluster:" +
engineState.length);
        for(int index = 0; index < engineState.length; index++)
        {
            EngineState engine =
stub.getEngineState(engineState[index].getEngineId() );
            LoggerUtils.sendToLogAndConsole(
                "Engine Id: " + engine.getEngineId() + "\n" +
                "Engine status: " + engine.getEngineStatus() + "\n" +
                "Value of engine status: " +
engine.getValueOfEngineStatus() + "\n" +
                "Heartbeat: " + ( (engine.getHeartbeat() != null) ?
engine.getHeartbeat().getTime().toString() : "null") + "\n" +
                "Shutdown time: " + ((engine.getShutdownTime()!= null)
? engine.getShutdownTime().getTime().toString() : "null") + "\n" +
                "Start time: " + ((engine.getStartTime() != null) ?
engine.getStartTime().getTime().toString() : "null") );
        }
    } 

reassignPercentageProcesses

Used to reassign a percentage of processes from the source engine to the target engine.

Method Signature

int reassignPercentageProcesses(int percent, java.lang.String sourceEngineId, java.lang.String targetEngineId)

Parameters

Parameter

Description

percent

An integer representing the percentage of processes to be reassigned.

sourceEngineId

The Id of the source workflow engine.

targetEngineIds

The Id of the target workflow engine.

reassignProcesses

Used to reassign one or more processes from the source engine to the target engine.

Method Signature

int reassignProcesses(com.novell.soa.af.impl.soap.StringArray requestIds, java.lang.String sourceEngineId, java.lang.String targetEngineId)

Parameters

Parameter

Description

requestIds

A list of requestIds of the processes to be reassigned.

sourceEngineId

The Id of the source workflow engine.

targetEngineIds

The Id of the target workflow engine.

removeEngine

Used to remove an engine from the cluster state table. The engine must be in the SHUTDOWN or TIMEDOUT state.

Method Signature

void removeEngine(java.lang.String engineId)

Parameters

Parameter

Description

engineId

The Id of the workflow engine to be removed.