# com.bea.wli.worklist.api
WorkSubstituteManager Interface

public interface WorkSubstituteManager

This class manages work substitute rules.

## Method Summary

`public `String`[]` | `addWorkSubstituteRules`(`WorkSubstituteRule`[] workSubstituteRules) Add the substitution rules to the database.
`public `WorkSubstituteRule`[]` | `getAllWorkSubstituteRules`() Get all work substitution rules currently in the database.
`public `String`` | `getWorkSubstitute`(`String` user, `Date` date) Get the substitute (target) for the given user (source) for the given date.
`public `WorkSubstituteRule`` | `getWorkSubstituteRule`(`String` ruleId) Get a work substitution rule.
`public `WorkSubstituteRule`[]` | `getWorkSubstituteRulesWithSource`(`String` source) Get all work substitution rules for the given source.
`public `WorkSubstituteRule`[]` | `getWorkSubstituteRulesWithTarget`(`String` target) Get all work substitution rules for the given target.
`public void` | `removeWorkSubstituteRules`(`String`[] workSubstituteRuleIds) Remove all the substitution rules from the database.
`public void` | `updateWorkSubstituteRules`(`WorkSubstituteRule`[] rules) Update work substitution rules.

## Method Detail

### addWorkSubstituteRules(WorkSubstituteRule[]) Method

    public String[] addWorkSubstituteRules(WorkSubstituteRule[] workSubstituteRules)
         throws ManagementException, RemoteException

Add the substitution rules to the database. If rule id is provided it will be used else a new one will be generated.

#### Parameters

workSubstituteRules
  containing rules to be added

#### Returns

array of unique rule ids

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### getAllWorkSubstituteRules() Method

    public WorkSubstituteRule[] getAllWorkSubstituteRules()
         throws ManagementException, RemoteException

Get all work substitution rules currently in the database.

#### Returns

array of work substitution rules

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### getWorkSubstitute(String, Date) Method

    public String getWorkSubstitute(String user,
                                    Date date)
         throws ManagementException, RemoteException

Get the substitute (target) for the given user (source) for the given date.

#### Parameters

user
  containing the source user or group name

#### Returns

the qualifying target

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### getWorkSubstituteRule(String) Method

    public WorkSubstituteRule getWorkSubstituteRule(String ruleId)
         throws ManagementException, RemoteException

Get a work substitution rule.

#### Returns

the work substitution rule

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### getWorkSubstituteRulesWithSource(String) Method

    public WorkSubstituteRule[] getWorkSubstituteRulesWithSource(String source)
         throws ManagementException, RemoteException

Get all work substitution rules for the given source.

#### Parameters

source
  (user or group)

#### Returns

array of qualifying work substitution rules

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### getWorkSubstituteRulesWithTarget(String) Method

    public WorkSubstituteRule[] getWorkSubstituteRulesWithTarget(String target)
         throws ManagementException, RemoteException

Get all work substitution rules for the given target.

#### Parameters

target
  (user or group)

#### Returns

array of qualifying work substitution rules

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### removeWorkSubstituteRules(String[]) Method

    public void removeWorkSubstituteRules(String[] workSubstituteRuleIds)
         throws ManagementException, RemoteException

Remove all the substitution rules from the database. If an exception occurs while removing any rule the whole transaction will be rolled back and no rules will be removed.

#### Parameters

workSubstituteRuleIds
  containing rule ids to be deleted

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed

### updateWorkSubstituteRules(WorkSubstituteRule[]) Method

    public void updateWorkSubstituteRules(WorkSubstituteRule[] rules)
         throws ManagementException, RemoteException

Update work substitution rules.

#### Exceptions

``ManagementException``
  if the operation failed
``RemoteException``
  if the communication failed