com.ibm.bpe.cm.api
Class ContentManager

java.lang.Object
  extended bycom.ibm.bpe.cm.api.ContentManager

public class ContentManager
extends java.lang.Object

This class provides access to the Content Manager / Process Choreographer integration function. It implements the "business delegate" pattern to hide any complexities involved with lookup of an EJB which eventually contains the real implementation.
Use these static functions inside a Process Choreographer Java snippet or inside a Java transition condition.
The integration code makes some assumptions about process attributes, the most important one is the Content Manager itemPID of an associated document or document folder. Use initializeCustomProperties at the very beginning of your business process to set these properties properly.


Field Summary
static int COLLECTIONPOINT_ERROR
          Return value for the Collection Point Service: An error occurred during collection point processing.
static int COLLECTIONPOINT_ITEM_DELETED
          Return value for the Collection Point Service: The associated item has been deleted.
static int COLLECTIONPOINT_OK
          Return value for the Collection Point Service: The condition is satisfied and processing of the request ended regularly.
static int COLLECTIONPOINT_TIMEOUT
          Return value for the Collection Point Service: The specified timeout is reached.
static java.lang.String PROCESS_PROPERTY_COMPONENTID
          Name of the custom process property to store the associated componentId string.
static java.lang.String PROCESS_PROPERTY_ITEMID
          Name of the custom process property to store the associated itemId string.
static java.lang.String PROCESS_PROPERTY_ITEMPID
          Name of the custom process property to store the associated itemPid string.
static java.lang.String PROCESS_PROPERTY_ITEMTYPE
          Name of the custom process property to store the associated itemType string.
static java.lang.String PROCESS_PROPERTY_VERSIONID
          Name of the custom process property to store the associated versionId string.
static java.lang.String SUBSTITUTABLE_PARAMETER_COMPONENTID
          Name of XPath query expression Component ID substitutable parameters
static java.lang.String SUBSTITUTABLE_PARAMETER_ITEMID
          Name of XPath query expression Item ID substitutable parameters
static java.lang.String SUBSTITUTABLE_PARAMETER_ITEMTYPE
          Name of XPath query expression Item Type ID substitutable parameters
static java.lang.String SUBSTITUTABLE_PARAMETER_VERSIONID
          Name of XPath query expression Version ID substitutable parameters
 
Constructor Summary
ContentManager()
           
 
Method Summary
static com.ibm.bpe.api.QueryResultSet combinedQuery(java.lang.String selectClauseWorkflow, java.lang.String flowItemTypeNameContent, java.lang.String flowItemTypeAttributesContent, java.lang.String additionalAttributesContent, java.lang.String whereClauseWorkflow, java.lang.String xPathContent, java.lang.String orderByClauseWorkflow, java.util.TimeZone timezoneWorkflow)
          Run a combined query for Process Choreographer and Content Manager data.
static boolean evaluateCondition(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String xPath)
          Evaluate a Content Manager XPath expression.
static java.lang.Object getContentAttribute(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String attributeSpecification)
          Get an attribute value of the item associated with the business process.
static java.util.ArrayList getContentAttributes(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String[] attributeSpecifications)
          Get multiple attributes of the item associated with the business process.
static java.lang.Object getFolderContentAttribute(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String attributeSpecification)
          Get an attribute value of item in the folder which is associated with the business process
Typically, the business process is associated with a folder rather than a single item.
static java.util.ArrayList getFolderContentAttributes(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String[] attributeSpecifications)
          Get multiple attribute values of items in the folder which is associated with the business process
Typically, the business process is associated with a folder rather than a single item.
static void initializeCustomProperties(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String itemPid)
          Use this function in a Java snippet at the very beginning of your business process to associate it with a Content Manager item.
static void initializeCustomProperties(com.ibm.bpe.framework.ProcessBase processBean, java.lang.String itemId, java.lang.String componentId, int versionId)
          Use this function in a Java snippet at the very beginning of your business process to associate it with a Content Manager item.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROCESS_PROPERTY_ITEMPID

public static final java.lang.String PROCESS_PROPERTY_ITEMPID
Name of the custom process property to store the associated itemPid string.

See Also:
Constant Field Values

PROCESS_PROPERTY_ITEMID

public static final java.lang.String PROCESS_PROPERTY_ITEMID
Name of the custom process property to store the associated itemId string.

See Also:
Constant Field Values

PROCESS_PROPERTY_COMPONENTID

public static final java.lang.String PROCESS_PROPERTY_COMPONENTID
Name of the custom process property to store the associated componentId string.

See Also:
Constant Field Values

PROCESS_PROPERTY_VERSIONID

public static final java.lang.String PROCESS_PROPERTY_VERSIONID
Name of the custom process property to store the associated versionId string.

See Also:
Constant Field Values

PROCESS_PROPERTY_ITEMTYPE

public static final java.lang.String PROCESS_PROPERTY_ITEMTYPE
Name of the custom process property to store the associated itemType string.

See Also:
Constant Field Values

SUBSTITUTABLE_PARAMETER_ITEMID

public static final java.lang.String SUBSTITUTABLE_PARAMETER_ITEMID
Name of XPath query expression Item ID substitutable parameters


SUBSTITUTABLE_PARAMETER_COMPONENTID

public static final java.lang.String SUBSTITUTABLE_PARAMETER_COMPONENTID
Name of XPath query expression Component ID substitutable parameters


SUBSTITUTABLE_PARAMETER_VERSIONID

public static final java.lang.String SUBSTITUTABLE_PARAMETER_VERSIONID
Name of XPath query expression Version ID substitutable parameters


SUBSTITUTABLE_PARAMETER_ITEMTYPE

public static final java.lang.String SUBSTITUTABLE_PARAMETER_ITEMTYPE
Name of XPath query expression Item Type ID substitutable parameters


COLLECTIONPOINT_OK

public static int COLLECTIONPOINT_OK
Return value for the Collection Point Service: The condition is satisfied and processing of the request ended regularly.


COLLECTIONPOINT_ERROR

public static int COLLECTIONPOINT_ERROR
Return value for the Collection Point Service: An error occurred during collection point processing. Check the log for details.


COLLECTIONPOINT_TIMEOUT

public static int COLLECTIONPOINT_TIMEOUT
Return value for the Collection Point Service: The specified timeout is reached.


COLLECTIONPOINT_ITEM_DELETED

public static int COLLECTIONPOINT_ITEM_DELETED
Return value for the Collection Point Service: The associated item has been deleted.

Constructor Detail

ContentManager

public ContentManager()
Method Detail

evaluateCondition

public static boolean evaluateCondition(com.ibm.bpe.framework.ProcessBase processBean,
                                        java.lang.String xPath)
Evaluate a Content Manager XPath expression. Use this function in a Process Choreographer transition condition to determine a flow route based on document contents.
For a given item type "T1" with an attribut "a1", a valid XPath expression would be "/T1[@a1='xy']".
If you want to refer to the document or folder associated with the business process, you may want to use the placeholder defined by SUBSTITUTABLE_PARAMETER_XXX to refer to itemId, componentId and version number of the item.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
xPath - A valid Content Manager XPath expression for a condition with optional substitutable parameters
Returns:
true, if the condition is true

getContentAttribute

public static java.lang.Object getContentAttribute(com.ibm.bpe.framework.ProcessBase processBean,
                                                   java.lang.String attributeSpecification)
Get an attribute value of the item associated with the business process.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
attributeSpecification - Attribute to retrieve in <item-type>/<attribute-name> format, e.g. "XYZ_ClaimForm/XYZ_DriversLic". Note that <attribute-name> can include child component names, e.g. Book/Chapter/Section/Author.
Returns:
An Object for the attribute value or null if the attribute cannot be resolved.
See Also:
getContentAttributes(ProcessBase, String[]), getFolderContentAttribute(ProcessBase, String), getFolderContentAttributes(ProcessBase, String [])

getContentAttributes

public static java.util.ArrayList getContentAttributes(com.ibm.bpe.framework.ProcessBase processBean,
                                                       java.lang.String[] attributeSpecifications)
Get multiple attributes of the item associated with the business process.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
attributeSpecifications - Attributes to retrieve in <item-type>/<attribute-name> format, e.g.
 new String[]
 {
     "XYZ_ClaimForm/XYZ_DriversLic",
     "XYZ_ClaimForm/XYZ_PolicyNum",
     "XYZ_AdjReport/XYZ_LicPlate"
 }
 
Note that <attribute-name> can include child component names, e.g. Book/Chapter/Section/Author.
Returns:
An ArrayList of ArrayLists (e.g. a table) containing one row for each returned attribute and columns for item type name, item pid string, attribute name and attribute value.
See Also:
getContentAttribute(ProcessBase, String), getFolderContentAttribute(ProcessBase, String), getFolderContentAttributes(ProcessBase, String[])

getFolderContentAttribute

public static java.lang.Object getFolderContentAttribute(com.ibm.bpe.framework.ProcessBase processBean,
                                                         java.lang.String attributeSpecification)
Get an attribute value of item in the folder which is associated with the business process
Typically, the business process is associated with a folder rather than a single item. The folder then contains one or more items - use this functions to retrieve a single attributes from such an item inside a folder (e.g. the license plate attribute in the adjuster's report item type).
If the business process is not associated with a folder or if you want to get attributes of the folder itself, use getContentAttribute instead. Note that attributes of the latest version are retrieved.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
attributeSpecification - Attributes to retrieve in <item-type>/<attribute-name> format, e.g. "XYZ_ClaimForm/XYZ_DriversLic". Note that <attribute-name> can include child component names, e.g. Book/Chapter/Section/Author.
Returns:
An Object for the attribute value or null if the attribute cannot be resolved.
See Also:
getFolderContentAttributes(ProcessBase, String[]), getContentAttribute(ProcessBase, String), getContentAttributes(ProcessBase, String [])

getFolderContentAttributes

public static java.util.ArrayList getFolderContentAttributes(com.ibm.bpe.framework.ProcessBase processBean,
                                                             java.lang.String[] attributeSpecifications)
Get multiple attribute values of items in the folder which is associated with the business process
Typically, the business process is associated with a folder rather than a single item. The folder then contains one or more items - use this functions to retrieve attributes from such items inside a folder (e.g. the license plate attribute in the adjuster's report item type).
If the business process is not associated with a folder or if you want to get attributes of the folder itself, use getContentAttributes instead. Note that attributes of the latest version are retrieved.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
attributeSpecifications - Attributes to retrieve in <item-type>/<attribute-name> format, e.g.
 new String[]
 {
     "XYZ_ClaimForm/XYZ_DriversLic",
     "XYZ_ClaimForm/XYZ_PolicyNum",
     "XYZ_AdjReport/XYZ_LicPlate"
 }
 
Note that <attribute-name> can include child component names, e.g. Book/Chapter/Section/Author.
Returns:
An ArrayList of ArrayLists (e.g. a table) containing one row for each returned attribute and columns for item type name, item pid string, attribute name and attribute value.
See Also:
getFolderContentAttribute(ProcessBase, String), getContentAttribute(ProcessBase, String), getContentAttributes(ProcessBase, String[])

combinedQuery

public static com.ibm.bpe.api.QueryResultSet combinedQuery(java.lang.String selectClauseWorkflow,
                                                           java.lang.String flowItemTypeNameContent,
                                                           java.lang.String flowItemTypeAttributesContent,
                                                           java.lang.String additionalAttributesContent,
                                                           java.lang.String whereClauseWorkflow,
                                                           java.lang.String xPathContent,
                                                           java.lang.String orderByClauseWorkflow,
                                                           java.util.TimeZone timezoneWorkflow)
Run a combined query for Process Choreographer and Content Manager data. For more details on the QueryResultSet and how to specify the clauses, also refer to the Process Choreographer documentation.
Note: If you plan to use this function from an EJB or Servlet context, consider calling combinedQuery on the ContentManagerIntegrationEjb instead using local EJB calls. This may give you better performance than through this business delegate class.

Parameters:
selectClauseWorkflow - The requested Process Choreographer column names. Must not be null.
flowItemTypeNameContent - The item type of the item which is routed through the flow This can be a document item type or a folder item type. Must not be null.
flowItemTypeAttributesContent - A comma separated list of attributes of the flow item type that should be returned in the result set.
additionalAttributesContent - If the flowItemTypeContent is a folder, this specifies an optional list of attributes of the contained documents. The list is comma separated and the attributes are specified in the form <itemtype>/<attribute>.
whereClauseWorkflow - The SQL where condition for Process Choreographer data, may be null.
xPathContent - An valid XPath expression to filter the Content Manager data. The result must be the flow item type. To express conditions on contained item attributes make sure to use an inboundlink to get to the folder item.
orderByClauseWorkflow - The order clause for Process Choreographer data, may be null.
timezoneWorkflow - A timezone specification for timestamp given or returned, may be null.
Returns:
The result of the combined query.

initializeCustomProperties

public static void initializeCustomProperties(com.ibm.bpe.framework.ProcessBase processBean,
                                              java.lang.String itemId,
                                              java.lang.String componentId,
                                              int versionId)
Use this function in a Java snippet at the very beginning of your business process to associate it with a Content Manager item. Information about an item could either be an itemPID string or values for itemId, componentId and versionId.
You typically get this reference information to a Content Manager item from an input variable of the business process.
This function sets certain process attribute values with item reference data required for other functions in this integration code.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
itemId - The itemId value of a Content Manager document or folder.
componentId - The componentId value of a Content Manager document or folder.
versionId - The versionId value of a Content Manager document or folder.
See Also:
initializeCustomProperties(ProcessBase, String)

initializeCustomProperties

public static void initializeCustomProperties(com.ibm.bpe.framework.ProcessBase processBean,
                                              java.lang.String itemPid)
Use this function in a Java snippet at the very beginning of your business process to associate it with a Content Manager item. Information about an item could either be an itemPID string or values for itemId, componentId and versionId.
You typically get this reference information to a Content Manager item from an input variable of the business process.
This function sets certain process attribute values with item reference data required for other functions in this integration code.

Parameters:
processBean - A reference to the bean holding the Java implementation in a business process In a Java snippet or in a Java transition condition, use this to get this reference.
itemPid - The itemPID string value of a Content Manager document or folder.
See Also:
initializeCustomProperties( ProcessBase, String, String , int )