この節では、プロビジョニングWebサービスのメソッドの詳細を説明します。
すべてのメソッドが、com.novell.soa.af.impl.soap.AdminExceptionとjava.rmi.RemoteExceptionをスローします。 読みやすくするために、メソッドの署名のthrows節は省略されています。
この項では、次のトピックについて説明します。
この節は、各プロセスメソッドに関する参照情報を取り上げています。メソッドには次のものが含まれています。
プロセスに関する情報を取得する場合に使用します。
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);
指定したステータス(たとえば、実行中のプロセスなど)のプロセスに関する情報を取得する場合に使用します。
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();
プロセスIDで指定したプロセスに関する情報を取得する場合に使用します。
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);
}
実行中および完了したすべてのプロビジョニング要求に関する情報を取得する場合に使用します。
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();
}
返されるプロセス数を制限する場合に使用します。ここに指定した値がシステムの制限値よりも小さい場合は、ここに指定した数のプロセスが返されます。システム制限値を超える値を指定した場合は、システム制限値に設定された数のプロセスが返されます。0以下の値を指定した場合は、すべてのプロセスが返されます。
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() );
}
}
プロセス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();
}
実行中のプロビジョニング要求を停止する場合に使用します。
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");
要求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);
}
ワークフロープロセスの作成時刻から現在の時刻までに作成されたプロセスに関する情報を取得する場合に使用します。
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);
指定した承認ステータス(Approved(承認)、Denied(拒否)、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();
特定の受信者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();
特定のイニシエータ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();
以前に完了したプロビジョニング要求のエンタイトルメント結果(承認ステータス)を設定する場合に使用します。
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);
2つの時間で指定された期間内に開始されたプロセスに関する情報を取得する場合に使用します。
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();
この節は、各プロビジョニングメソッドに関する参照情報を取り上げています。プロビジョニングメソッドには次のものが含まれています。
指定した各受信者に対するワークフロー要求を開始する場合に使用します。
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);
}
}
}
プロビジョニング要求を開始する場合に使用します。
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);
上記の例では、startProvisioningRequestメソッドを呼び出しています。このメソッドは、IDMユーザアプリケーションの一部ではありません。ここでは、例を完了させるためにこれを使用しています。
/**
*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)
}
.
.
.
利用可能なプロビジョニング要求の配列を返す場合に使用します。
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();
}
特定のカテゴリや操作のプロビジョニング要求の配列を返す場合に使用します。
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();
}
com.novell.soa.af.impl.soap.StringArray getProvisioningCategories()
StringArray categoriesStringArray = stub.getProvisioningCategories();
String [] categories = categoriesStringArray.getString();
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);
}
}
}
}
プロビジョニング要求のステータスを取得する場合に使用します。
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);
ワークフローを開始し、デジタル署名が必要なことを指定する場合に使用します。
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)
}
}
}
}
代理人をイニシエータとしてワークフローを開始し、デジタル署名が必要なことを指定する場合に使用します。
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);
}
}
}
}
correlation IDを使ってワークフローを開始する場合に使用します。correlation IDは、関連するワークフロープロセスセットを追跡する方法を提供しています。このメソッドで開始したワークフロープロセスは、クエリしたり、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;
この節は、各ワークエントリメソッドに関する参照情報を取り上げています。ワークエントリメソッドには、次のものが含まれています。
タスクを、ワークフロー内の適切なアクション(承認、却下、拒否)がある次のアクティビティに転送する場合に使用します。
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);
}
}
あるユーザから別のユーザにタスクを再割り当てする場合に使用します。
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);
}
}
タスクのID(UUID)により識別されるワークエントリのデータ項目を取得する場合に使用します。
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());
}
デジタル署名とオプションのデジタル署名プロパティ付きのプロビジョニング要求を転送する場合に使用します。たとえば、管理者がユーザ向きアクティビティの承認、却下、拒否を強制させる場合などに使用します。
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);
}
}
プロビジョニング要求を転送する場合に使用します。たとえば、管理者がユーザ向きアクティビティの承認、却下、拒否を強制させる場合などに使用します。
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); }
}
プロビジョニング要求のクレーム(引き受け)を解除する場合に使用します。このメソッドは、ユーザアプリケーションで要求が引き受けられた場合にのみ機能します。forward APIメソッド(転送を参照)では、1つの操作で引き受けと転送を行うため、SOAPインタフェースを使って引き受けが転送された場合、要求の引き受けを解除することはできません。
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);
}
デジタル署名とデジタル署名プロパティ付きのプロビジョニング要求を転送する場合に使用します。たとえば、管理者がユーザ向きアクティビティの承認、却下、拒否を強制させる場合などに使用します。
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);
}
}
あるユーザから別のユーザにタスクを再割り当てする場合に使用します。
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);
}
}
ワークエントリ(アクティビティ)にクエリして、クエリの条件を満たすWorkEntryオブジェクトのリストを返す場合に使用します。
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();
ワークフローアクティビティの定数に関する情報を取得する場合に使用します。このメソッドが機能するためには、ワークフロー設計者によりワークフローアクティビティの定数が実際に指定されていなければなりません。
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();
タスクの優先度をリセットする場合に使用します。このメソッドは、承認の分岐が1つのプロビジョニング要求にのみ使用してください。
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);
}
この節は、各コメントメソッドに関する参照情報を取り上げています。コメントメソッドには次のものが含まれています。
特定のタイプ(ユーザ、システムなど)のワークフローコメントを取得する場合に使用します。
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() );
}
}
}
特定のアクティビティのコメントを取得する場合に使用します。
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();
}
}
特定のユーザが行ったコメントを取得する場合に使用します。
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();
特定の時刻に行われたコメントを取得する場合に使用します。
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();
ワークフローアクティビティにコメントを追加する場合に使用します。
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);
ワークフローからコメントを取得する場合に使用します。
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();
この節は、各環境設定メソッドに関する参照情報を取り上げています。環境設定メソッドには次のものが含まれています。
完了したプロセスのタイムアウトを設定する場合に使用します。タイムアウトに指定した日数より前に完了したプロセスは、システムから削除されます。デフォルトは120日です。0~365日の値を指定できます。
void setCompletedProcessTimeout(int time)
accessConfigurationSettings(SET_COMPLETED_PROCESS_TIMEOUT, new Integer(212) );
ワークフローエンジン環境設定パラメータを設定する場合に使用します。
void setEngineConfiguration(com.novell.soa.af.impl.soap.Configuration config)
accessConfigurationSettings(SET_ENGINE_CONFIGURATION, new Integer(313) );
完了したプロセスのタイムアウトを取得する場合に使用します。
int getCompletedProcessTimeout()
accessConfigurationSettings(GET_COMPLETED_PROCESS_TIMEOUT, new Integer(121) );
電子メール通知をグローバルに有効/無効にする場合に使用します。
void setEmailNotifications(boolean enable)
accessConfigurationSettings(SET_EMAIL_NOTIFICATIONS, new Boolean(false) );
Novell Integration Manager(以前のexteNd Composer)キャッシュを消去します。
void clearNIMCaches()
accessConfigurationSettings(CLEAR_NIM_CACHES, new Object() );
Webサービスアクティビティのタイムアウトを設定する場合に使用します。デフォルト値は50分です。1分から7日までの範囲の値を指定できます。
void setWebServiceActivityTimeout(int time)
accessConfigurationSettings(SET_WEBSERVICE_ACTIVITY_TIMEOUT, new Integer(767) );
ユーザ向きアクティビティのタイムアウトを取得する場合に使用します。
int getUserActivityTimeout()
accessConfigurationSettings(GET_USER_ACTIVITY_TIMEOUT, new Integer(3767) );
グローバル電子メール通知が有効か、または無効かを判断する場合に使用します。
boolean getEmailNotifications()
accessConfigurationSettings(GET_EMAIL_NOTIFICATIONS, new Boolean(true) );
ユーザ向きアクティビティのタイムアウトを設定する場合に使用します。デフォルトではタイムアウトはありません(ゼロ)。1時間から365日までの範囲の値を指定できます。
void setUserActivityTimeout(int time)
accessConfigurationSettings(SET_USER_ACTIVITY_TIMEOUT, new Integer(1767) );
ワークフローエンジン環境設定パラメータを取得する場合に使用します。
com.novell.soa.af.impl.soap.Configuration getEngineConfiguration()
accessConfigurationSettings(GET_ENGINE_CONFIGURATION, new Integer(141) );
Webサービスアクティビティのタイムアウトを取得する場合に使用します。
int getWebServiceActivityTimeout()
accessConfigurationSettings(GET_WEBSERVICE_ACTIVITY_TIMEOUT, new Integer(808) );
この節は、その他のメソッドに関する参照情報を取り上げています。その他のメソッドには次のものが含まれています。
ワークフローのJPGイメージを取得する場合に使用します。アプリケーションサーバとIDMユーザアプリケーションが動作するコンピュータには、Graphvizプログラムをインストールしておく必要があります。 Graphvizの詳細は、「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);
}
プロビジョニング要求のXMLを取得する場合に使用します。
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);
}
プロビジョニング要求のフォームのXMLを取得する場合に使用します。
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);
}
ワークフローシステムのバージョンを取得する場合に使用します。
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());
}
この節は、各クラスタメソッドに関する参照情報を取り上げています。クラスタメソッドには次のものが含まれています。
エンジンIDで指定された、ワークフローエンジンのIEngineStateを取得する場合に使用します。
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") );
}
}
ソースエンジンのすべてのプロセスを、ターゲットエンジンのリストに再割り当てする場合に使用します。
int reassignAllProcesses(java.lang.String sourceEngineId, com.novell.soa.af.impl.soap.StringArray targetEngineIds)
クラスタ内の各エンジンに対して、IEngineStateオブジェクトを含むリストを取得する場合に使用します。
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") );
}
}
ソースエンジンからターゲットエンジンに、パーセンテージを指定してプロセスを再割り当てする場合に使用します。
int reassignPercentageProcesses(int percent, java.lang.String sourceEngineId, java.lang.String targetEngineId)
ソースエンジンからターゲットエンジンに、1つまたは複数のプロセスを再割り当てする場合に使用します。
int reassignProcesses(com.novell.soa.af.impl.soap.StringArray requestIds, java.lang.String sourceEngineId, java.lang.String targetEngineId)