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.
This section includes the following topics:
This section provides reference information for each Processes method. The methods include:
Used to get information about processes.
com.novell.soa.af.impl.soap.ProcessArray getProcessesByQuery(com.novell.soa.af.impl.soap.T_ProcessInfoQuery query, int maxRecords)
//
// 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);
Used to get information about processes with a specified status (for example, running processes).
public com.novell.soa.af.impl.soap.ProcessArray getProcessesByStatus(com.novell.soa.af.impl.soap.T_ProcessStatus status)
T_ProcessStatus processStatus = T_ProcessStatus.Running;
//
// Get processes by status
ProcessArray processArray = stub.getProcessesByStatus(processStatus);
Process [] process = processArray.getProcess();
Used to get information about processes, specified by processID.
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)
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);
}
Used to get information about all running and completed provisioning requests.
com.novell.soa.af.impl.soap.ProcessArray getAllProcesses()
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();
}
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.
com.novell.soa.af.impl.soap.ProcessArray getProcessesArray(int maxRecords);
/**
* 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() );
}
}
Used to get information about a specific process, specified by the Process Id.
com.novell.soa.af.impl.soap.ProcessArray getProcessesById(java.lang.String id)
Process [] allProcesses = stub.getAllProcesses().getProcess();
if(allProcesses != null)
{
String processId = allProcesses[0].getProcessId;
ProcessArray array = stub.getProcessesById(processId);
Process [] processes = array.getProcess();
}
Used to terminate a running provisioning request.
void terminate(java.lang.String requestId, com.novell.soa.af.impl.soap.T_TerminationType state, java.lang.String comment)
//
// 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");
Used to get information about a running or completed provisioning request, specified by Request ID.
com.novell.soa.af.impl.soap.Process getProcess(java.lang.String requestId)
// // 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);
}
Used to get information about processes created between the current time and the time at which the workflow process was created.
com.novell.soa.af.impl.soap.ProcessArray getProcessesByCreationTime(long time, com.novell.soa.af.impl.soap.T_Operator op)
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);
Used to get information about processes with a specified approval status (Approved, Denied, or Retracted).
com.novell.soa.af.impl.soap.ProcessArray getProcessesByApprovalStatus(com.novell.soa.af.impl.soap.T_ApprovalStatus status)
T_ApprovalStatus approvalStatus = T_ApprovalStatus.Approved;
//
// Get all the processes based upon approval status above
ProcessArray processArray = stub.getProcessesByApprovalStatus(approvalStatus);
Process [] processes = processArray.getProcess();
Used to get information about processes that have a specific recipient Id.
com.novell.soa.af.impl.soap.ProcessArray getProcessesByRecipient(java.lang.String recipient)
String recipient = "cn=ablake,ou=users,ou=idmsample-komodo,o=novell";
//
// Get processes by recipient
ProcessArray processArray = stub.getProcessesByRecipient(recipient);
Process [] process = processArray.getProcess();
Used to get information about processes that have a specific initiator Id.
com.novell.soa.af.impl.soap.ProcessArray getProcessesByInitiator(java.lang.String initiator)
String initiator = "cn=admin,ou=idmsample-komodo,o=novell";
//
// Get processes by initiator
ProcessArray processArray = stub.getProcessesByInitiator(initiator);
Process [] process = processArray.getProcess();
Used to set the entitlement result (approval status) of a previously completed provisioning request.
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)
//
// 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);
Used to get information about processes started between two specified times.
com.novell.soa.af.impl.soap.ProcessArray getProcessesByCreationInterval(long start, long end)
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();
This section provides reference information for each Provisioning method. The Provisioning methods include:
Used to start a workflow request for each specified recipient.
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)
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);
}
}
}
Used to start a provisioning request.
java.lang.String start(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items)
// // 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 IDM User Application. 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)
}
.
. .
Used to return an array of available provisioning requests.
com.novell.soa.af.impl.soap.ProvisioningRequestArray getAllProvisioningRequests(java.lang.String recipient)
//
// 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();
}
Used to return an array of provisioning requests for a specified category and operation.
com.novell.soa.af.impl.soap.ProvisioningRequestArray getProvisioningRequests(java.lang.String recipient, java.lang.String category, java.lang.String operation)
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();
}
Used to get the list of available provisioning categories.
com.novell.soa.af.impl.soap.StringArray getProvisioningCategories()
StringArray categoriesStringArray = stub.getProvisioningCategories();
String [] categories = categoriesStringArray.getString();
Used to start a workflow as a proxy.
java.lang.String startAsProxy(java.lang.String processId, java.lang.String recipient, com.novell.soa.af.impl.soap.DataItemArray items, java.lang.String proxyUser)
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);
}
}
}
}
Used to get the status of provisioning requests.
com.novell.soa.af.impl.soap.ProvisioningStatusArray getProvisioningStatuses(com.novell.soa.af.impl.soap.T_ProvisioningStatusQuery query, int maxRecords)
//
// 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);
Used to start a workflow and specify that a digital signature is required.
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)
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)
}
}
}
}
Used to start a workflow using a proxy for the initiator, and specify that a digital signature is required.
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)
//
// 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);
}
}
}
}
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.
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;
This section provides reference information for each Work Entries method. The Work Entries methods include:
Used to forward a task to the next activity in the workflow with the appropriate action (approve, deny, refuse).
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)
//
// 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);
}
}
Used to reassign a task from one user to another.
void reassignWorkTask(java.lang.String wid, java.lang.String addressee, java.lang.String comment)
//
// 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);
}
}
Used to retrieve data items for a work entry identified by the Id (UUID) of a task.
com.novell.soa.af.impl.soap.DataItemArray getWork(java.lang.String workId)
//
// 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());
}
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.
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)
//
// 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);
}
}
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.
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)
//
// 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;
String proxyUser = ServiceUtils.getInstance().getLoginData().getUsername(LoginData.PROXY_TYPE);
stub.forwardAsProxy(workId, _action, newDataItemArray, comment, proxyUser); }
}
Used to unclaim a provisioning request. This method only works if the request was claimed in the User Application. 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.
void unclaim(java.lang.String wid, java.lang.String comment)
// 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);
}
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.
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)
//
// 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;
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);
}
}
Used to reassign a task from one user to another.
void reassign(java.lang.String wid, java.lang.String addressee, java.lang.String comment)
//
// 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);
}
}
Used to query the work entries (activities) and returns a list of WorkEntry objects that satisfy the query.
com.novell.soa.af.impl.soap.WorkEntryArray getWorkEntries(com.novell.soa.af.impl.soap.T_WorkEntryQuery query, int maxRecords)
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();
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.
com.novell.soa.af.impl.soap.Quorum getQuorumForWorkTask((java.lang.String workId)
//
// 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();
Used to reset the priority for a task. You should only use this method on provisioning requests that have a single approval branch.
void resetPriorityForWorkTask(java.lang.String workId, int priority, java.lang.String comment)
// 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);
}
This section provides reference information for each Comments method. The Comments methods include:
Used to get workflow comments that are of a specific type (for example, user, system).
com.novell.soa.af.impl.soap.CommentArray getCommentsByType(java.lang.String requestId, com.novell.soa.af.impl.soap.T_CommentType type)
//
// 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() );
}
}
}
Used to get the comments for a specific activity.
com.novell.soa.af.impl.soap.CommentArray getCommentsByActivity(java.lang.String requestId, java.lang.String aid)
//
// 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();
}
}
Used to get the comments made by a specific user.
com.novell.soa.af.impl.soap.CommentArray getCommentsByUser(java.lang.String requestId, java.lang.String user)
//
// 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();
Used to get comments made at a specific time.
com.novell.soa.af.impl.soap.CommentArray getCommentsByCreationTime(java.lang.String requestId, long time, com.novell.soa.af.impl.soap.T_Operator op)
//
// 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();
Used to add a comment to a workflow activity.
void addComment(java.lang.String workId, java.lang.String comment)
// // 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);
Used to get comments from a workflow.
com.novell.soa.af.impl.soap.CommentArray getComments(java.lang.String workId, int maxRecords)
//
// 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();
This section provides reference information for each Configuration method. The Configuration methods include:
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.
void setCompletedProcessTimeout(int time)
accessConfigurationSettings(SET_COMPLETED_PROCESS_TIMEOUT, new Integer(212) );
Used to set workflow engine configuration parameters.
void setEngineConfiguration(com.novell.soa.af.impl.soap.Configuration config)
accessConfigurationSettings(SET_ENGINE_CONFIGURATION, new Integer(313) );
Used to get the timeout for completed processes.
int getCompletedProcessTimeout()
accessConfigurationSettings(GET_COMPLETED_PROCESS_TIMEOUT, new Integer(121) );
Used to globally enable or disable e-mail notifications.
void setEmailNotifications(boolean enable)
accessConfigurationSettings(SET_EMAIL_NOTIFICATIONS, new Boolean(false) );
Clear the Novell Integration Manager (previously named exteNd Composer) caches.
void clearNIMCaches()
accessConfigurationSettings(CLEAR_NIM_CACHES, new Object() );
Used to set the timeout for Web service activities. The default value is 50 minutes. The valid range is 1 minute to 7 days.
void setWebServiceActivityTimeout(int time)
accessConfigurationSettings(SET_WEBSERVICE_ACTIVITY_TIMEOUT, new Integer(767) );
Used to get the timeout for user-facing activities.
int getUserActivityTimeout()
accessConfigurationSettings(GET_USER_ACTIVITY_TIMEOUT, new Integer(3767) );
Used to determine if global e-mail notifications are enabled or disabled.
boolean getEmailNotifications()
accessConfigurationSettings(GET_EMAIL_NOTIFICATIONS, new Boolean(true) );
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.
void setUserActivityTimeout(int time)
accessConfigurationSettings(SET_USER_ACTIVITY_TIMEOUT, new Integer(1767) );
Used to get the workflow engine configuration parameters.
com.novell.soa.af.impl.soap.Configuration getEngineConfiguration()
accessConfigurationSettings(GET_ENGINE_CONFIGURATION, new Integer(141) );
Used to get the timeout for Web service activities.
int getWebServiceActivityTimeout()
accessConfigurationSettings(GET_WEBSERVICE_ACTIVITY_TIMEOUT, new Integer(808) );
This section provides reference information for each Miscellaneous method. The Miscellaneous methods include:
Used to get a JPG image of the workflow. The Graphviz program must be installed on the computer where the application server and the IDM User Application is running. For more information about Graphviz, see Graphviz.
byte[] getGraph(java.lang.String processId)
//
// 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);
}
Used to get the XML for a provisioning request.
java.lang.String getFlowDefinition(java.lang.String processId)
//
// 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);
}
Used to get the XML for a form for a provisioning request.
java.lang.String getFormDefinition(java.lang.String processId)
//
// 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);
}
Used to get the version of the workflow system.
com.novell.soa.af.impl.soap.T_Version getVersion()
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());
}
This section provides reference information for each Cluster method. The Cluster methods include:
Used to get the IEngineState for a workflow engine, specified by engine Id.
com.novell.soa.af.impl.soap.EngineState getEngineState(java.lang.String engineId)
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") );
}
}
Used to reassign all processes from the source engine to a list of target engines.
int reassignAllProcesses(java.lang.String sourceEngineId, com.novell.soa.af.impl.soap.StringArray targetEngineIds)
Used to get a list that contains an IEngineState object for each engine in the cluster.
public com.novell.soa.af.impl.soap.EngineState getEngineState(java.lang.String engineId)
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") );
}
}
Used to reassign a percentage of processes from the source engine to the target engine.
int reassignPercentageProcesses(int percent, java.lang.String sourceEngineId, java.lang.String targetEngineId)
Used to reassign one or more processes from the source engine to the target engine.
int reassignProcesses(com.novell.soa.af.impl.soap.StringArray requestIds, java.lang.String sourceEngineId, java.lang.String targetEngineId)