Skip navigation links

Oracle Fusion Middleware
Workflow Services Java API Reference for Oracle SOA Suite
11g Release 1 (11.1.1)
E10660-03


oracle.bpel.services.workflow.assignment.dynamic
Class DynamicAssignmentUtils

java.lang.Object
  extended by oracle.bpel.services.workflow.assignment.dynamic.DynamicAssignmentUtils


public class DynamicAssignmentUtils
extends java.lang.Object

This class provides a number of static utility methods that are useful to anyone writing implementations of IDynamicAssignmentFunctions. Methods are provided for getting users who are currently available for assignment (not on vacation), for querying the Workflow persistency store, and for interacting with the identity service.

Since:
10.1.3.1.0

Constructor Summary
DynamicAssignmentUtils()
           

 

Method Summary
static void endTransaction(boolean startedTransaction)
          Handles transaction cleanip after querying from the workflow database tables.
static java.sql.ResultSet executeQuery(java.lang.String query, boolean startedTransaction)
          Executes the specified query against the workflow persistency schema.
static java.util.List getAvailableUsersFromGroup(java.lang.String group, java.lang.String realm)
          Method returns a list of users belonging to the specified group that are available for assignment.
static java.util.List getAvailableUsersFromList(java.util.List<java.lang.String> usernames, java.lang.String realm)
          Method returns a list of users from the specified list that are available.
static java.util.List getGroupsFromGroup(java.lang.String groupName, java.lang.String realm, boolean directsOnly)
          Method uses the specified group name to lookup the sub-groups belonging to that group using the identity service.
static java.lang.String getIDServiceDefaultRealm()
          Gets the default realm for the identity service.
static java.lang.String getSQLCommaSeperatedList(java.util.List list)
          Converts a list of objects into a comma seperated list of Strings suitable for use in SQL query
static java.util.List getUsersFromGroup(java.lang.String groupName, java.lang.String realm)
          Method uses the specified group name to lookup the users belonging to that group using the identity service.
static boolean isUserAvailable(java.lang.String username, java.lang.String realm)
          Method determine if the specified user is available for assignment.
static boolean startTransaction()
          Ensures a transaction is open prior to querying from the workflow database tables.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DynamicAssignmentUtils

public DynamicAssignmentUtils()

Method Detail

getUsersFromGroup

public static java.util.List getUsersFromGroup(java.lang.String groupName,
                                               java.lang.String realm)
                                        throws DynamicAssignmentException
Method uses the specified group name to lookup the users belonging to that group using the identity service.
Parameters:
groupName - String name of group to lookup
realm - to lookup group in - if null, then use identity service default realm
Returns:
List of String usernames of user
Throws:
DynamicAssignmentException - if group could not be found

getGroupsFromGroup

public static java.util.List getGroupsFromGroup(java.lang.String groupName,
                                                java.lang.String realm,
                                                boolean directsOnly)
                                         throws DynamicAssignmentException
Method uses the specified group name to lookup the sub-groups belonging to that group using the identity service.
Parameters:
groupName - name of group to lookup
realm - to lookup group in - if null, then use identity service default realm
directsOnly - if true return only the direct sub-groups of this group. If false, return all groups belonging to this group.
Returns:
List of String names of groups
Throws:
DynamicAssignmentException - if group could not be found

getIDServiceDefaultRealm

public static java.lang.String getIDServiceDefaultRealm()
                                                 throws DynamicAssignmentException
Gets the default realm for the identity service.
Returns:
String realm name
Throws:
DynamicAssignmentException - if error occurs accessing the IdentityService

startTransaction

public static boolean startTransaction()
                                throws java.lang.Exception
Ensures a transaction is open prior to querying from the workflow database tables. If there is no transaction currently open, a new transaction is opened, and the method returns true, if there is a transaction already open, the method does nothing, and returns false. This method should be called before calling the executeQuery method in this class.
Returns:
true if new trasnaction was started, false if a transaction was already open.
Throws:
java.lang.Exception - if error occurs starting transaction

endTransaction

public static void endTransaction(boolean startedTransaction)
                           throws java.lang.Exception
Handles transaction cleanip after querying from the workflow database tables. This method should be called after calling startTransaction() then executeQuery(). The value returned by the call to startTransaction() should be passed as the parameter to this transaction.
Parameters:
startedTransaction - if true, close the current transaction, if false, do nothing.
Throws:
java.lang.Exception - if error occurs closing transaction

executeQuery

public static java.sql.ResultSet executeQuery(java.lang.String query,
                                              boolean startedTransaction)
                                       throws java.lang.Exception
Executes the specified query against the workflow persistency schema. Results are returned in the form of a java.sql.ResultSet. The method startTransaction() in this class should always be called prior to calling this method. The value returned by the call to startTransaction should be passed to the startedTransaction parameter of this method. The method endTransaction() in this class should always be called after calling this method.
Parameters:
query - String SQL Query to be executed
startedTransaction - this should be the value returned from call to startTransaction()
Returns:
ResultSet result of query
Throws:
java.lang.Exception - if error occurs

isUserAvailable

public static boolean isUserAvailable(java.lang.String username,
                                      java.lang.String realm)
                               throws DynamicAssignmentException
Method determine if the specified user is available for assignment.
Parameters:
username - String name of user
realm - String name of Identity Service realm user belongs to. If realm is null, then metho will use the default realm.
Returns:
true if user is available, false if they are on vacation
Throws:
DynamicAssignmentException - if error occured querying user availability.

getAvailableUsersFromGroup

public static java.util.List getAvailableUsersFromGroup(java.lang.String group,
                                                        java.lang.String realm)
                                                 throws DynamicAssignmentException
Method returns a list of users belonging to the specified group that are available for assignment.
Parameters:
group - - name of group to lookup users for
realm - - Identity Service realm the group belongs to. If realm is null, method will use the default realm.
Returns:
List of String usernames of available users
Throws:
DynamicAssignmentException - if error encountered looking up group, or checking users.

getAvailableUsersFromList

public static java.util.List getAvailableUsersFromList(java.util.List<java.lang.String> usernames,
                                                       java.lang.String realm)
                                                throws DynamicAssignmentException
Method returns a list of users from the specified list that are available.
Parameters:
usernames - - List of String usernames to check
realm - - realm that the users belong to. If realm is null, method will use the default realm.
Returns:
List of String usernames of available users
Throws:
DynamicAssignmentException - if error encountered looking up group, or checking users.

getSQLCommaSeperatedList

public static java.lang.String getSQLCommaSeperatedList(java.util.List list)
Converts a list of objects into a comma seperated list of Strings suitable for use in SQL query
Parameters:
list - List of Objects (usually Strings)
Returns:
List of the form 'listItem0','listItem1'...,'listItemN'

Skip navigation links

Oracle Fusion Middleware
Workflow Services Java API Reference for Oracle SOA Suite
11g Release 1 (11.1.1)
E10660-03


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.