com.ibm.itim.workflow.model
Class PackagedApprovalDocument

java.lang.Object
  extended by com.ibm.itim.workflow.model.PackagedApprovalDocument
All Implemented Interfaces:
java.io.Serializable

public class PackagedApprovalDocument
extends java.lang.Object
implements java.io.Serializable

This class is used as a workflow relevant data item for activities that require an approval decision on multiple items in one atomic step. It is composed of a List of PackagedApprovalItems, which represent the individual items in the approval request.

Individual decisions can be recorded in this document and passed back through the workflow assignment APIs to complete the assignment with the correct output parameters.

For example, on certain workflow manual activities, a document instance can be obtained from a pending workflow assignment's input parameters (@see com.ibm.itim.apps.workflow.WorkflowAssignmentMO.getInputParameters()) and then placed into an ActivityResult's detail field with updated decisions, as an output parameters. Then, the workflow assignment can be completed (@see com.ibm.itim.apps.workflow.WorkflowAssignmentMO.complete(ActivityResult)), allowing the workflow to proceed. *

Since:
ITIM 5.1
See Also:
Serialized Form

Constructor Summary
PackagedApprovalDocument()
          Constructs an empty packaged approval document, including an empty list of approval items.
PackagedApprovalDocument(java.util.List<PackagedApprovalItem> itemList)
          Constructs a packaged approval document with the specified list of approval items, which should be non-null.
PackagedApprovalDocument(java.lang.String comments, java.util.List<PackagedApprovalItem> itemList)
          Constructs a packaged approval document with the specified comments and list of approval items, which should be non-null.
 
Method Summary
 boolean addItem(PackagedApprovalItem item)
          Adds the specified PackagedApprovalItem to the items list.
 boolean checkItemsForDecisionCode(java.lang.String decisionCode)
          Checks the document for the specified String decision code.
 int countDecisionItemsByType(PackagedApprovalItem.ItemType itemType, boolean includeChildren)
          Examines the document to count the number of items supporting a decision of the specified type.
 int countItemsByType(PackagedApprovalItem.ItemType itemType, boolean includeChildren)
          Examines the document to count the number of items of the specified type.
 boolean equals(java.lang.Object o)
          Compares the values in the document.
 java.lang.String getComments()
          Retrieves the comments in this document.
 java.util.List<PackagedApprovalItem> getDocumentItems()
          Retrieves the list of approval items in this document.
 java.util.List<PackagedApprovalItem> getItemsByType(PackagedApprovalItem.ItemType itemType)
          Searches the document for any top-level items with the specified ItemType.
 java.util.List<PackagedApprovalItem> getItemsByTypeAndDecision(PackagedApprovalItem.ItemType itemType, java.lang.String decisionCode)
          Searches the document for any top-level items with both the specified ItemType and String decision code.
 int hashCode()
          Returns the hashCode for the document.
 boolean removeItem(java.lang.String itemId)
          Removes the specified PackagedApprovalItem from the items list based on the item's identifying string.
 void setComments(java.lang.String comments)
          Sets the comments in this document.
 void setDecisionForAllItems(java.lang.String decisionCode)
          Sets the specified decision code String on all items in this document, including any children of top-level items.
 void setDocumentItems(java.util.List<PackagedApprovalItem> documentItems)
          Sets the list of approval items in this document.
 java.lang.String toString()
          Returns a String containing the values of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PackagedApprovalDocument

public PackagedApprovalDocument()
Constructs an empty packaged approval document, including an empty list of approval items.


PackagedApprovalDocument

public PackagedApprovalDocument(java.util.List<PackagedApprovalItem> itemList)
Constructs a packaged approval document with the specified list of approval items, which should be non-null.

Parameters:
itemList - List of PackagedApprovalItem for the document

PackagedApprovalDocument

public PackagedApprovalDocument(java.lang.String comments,
                                java.util.List<PackagedApprovalItem> itemList)
Constructs a packaged approval document with the specified comments and list of approval items, which should be non-null.

Parameters:
comments - for the document
itemList - List of PackagedApprovalItem for the document
Method Detail

getComments

public java.lang.String getComments()
Retrieves the comments in this document.

Returns:
the comments

setComments

public void setComments(java.lang.String comments)
Sets the comments in this document.

Parameters:
comments - for this document

getDocumentItems

public java.util.List<PackagedApprovalItem> getDocumentItems()
Retrieves the list of approval items in this document.

Returns:
a List of PackagedApprovalItems

setDocumentItems

public void setDocumentItems(java.util.List<PackagedApprovalItem> documentItems)
Sets the list of approval items in this document.

Parameters:
documentItems - a List of PackagedApprovalItems

checkItemsForDecisionCode

public boolean checkItemsForDecisionCode(java.lang.String decisionCode)
Checks the document for the specified String decision code. This includes recursing the document structure to examine children of each item. Any items that don't support decisions are skipped, but their children will be examined.

Parameters:
decisionCode - the String decision to search for
Returns:
boolean, true iff the decision is found

countItemsByType

public int countItemsByType(PackagedApprovalItem.ItemType itemType,
                            boolean includeChildren)
Examines the document to count the number of items of the specified type. Depending on the boolean setting includeChildren, this method may or may not consider children of the top-level items.

Parameters:
itemType - the ItemType to search for
includeChildren - a boolean flag indicating whether to examine at the children
Returns:
the int number of items

countDecisionItemsByType

public int countDecisionItemsByType(PackagedApprovalItem.ItemType itemType,
                                    boolean includeChildren)
Examines the document to count the number of items supporting a decision of the specified type. Depending on the boolean setting includeChildren, this method may or may not consider children of the top-level items.

Parameters:
itemType - the ItemType to search for
includeChildren - a boolean flag indicating whether to examine at the children
Returns:
the int number of items

getItemsByType

public java.util.List<PackagedApprovalItem> getItemsByType(PackagedApprovalItem.ItemType itemType)
Searches the document for any top-level items with the specified ItemType. Returns the items located, along with their full attributes and children in a List.

Parameters:
itemType - the ItemType to search for
Returns:
a List of PackagedApprovalItem objects located

getItemsByTypeAndDecision

public java.util.List<PackagedApprovalItem> getItemsByTypeAndDecision(PackagedApprovalItem.ItemType itemType,
                                                                      java.lang.String decisionCode)
Searches the document for any top-level items with both the specified ItemType and String decision code. Returns the items located, along with their full attributes and children in a List. Any items that don't support decisions are skipped.

Parameters:
itemType - the ItemType to search for
decisionCode - the String decision code to search for
Returns:
a List of PackagedApprovalItem objects located

setDecisionForAllItems

public void setDecisionForAllItems(java.lang.String decisionCode)
Sets the specified decision code String on all items in this document, including any children of top-level items. Any items that don't support decisions are skipped.

Parameters:
decisionCode - the String decision code to use

hashCode

public int hashCode()
Returns the hashCode for the document.

Overrides:
hashCode in class java.lang.Object
Returns:
the integer hashCode

equals

public boolean equals(java.lang.Object o)
Compares the values in the document.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare this document against
Returns:
true iff the documents contain equivalent elements

toString

public java.lang.String toString()
Returns a String containing the values of the object.

Overrides:
toString in class java.lang.Object
Returns:
String value

addItem

public boolean addItem(PackagedApprovalItem item)
Adds the specified PackagedApprovalItem to the items list.

Parameters:
item - the item to add
Returns:
true if the item was added

removeItem

public boolean removeItem(java.lang.String itemId)
Removes the specified PackagedApprovalItem from the items list based on the item's identifying string.

Parameters:
itemId - the String identifier for the item
Returns:
true if the item was removed


IBM Security Identity Manager 6.0.0
© Copyright International Business Machines Corporation 2007, 2012. All rights reserved. US Government Users Restricited Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.