com.sap.netweaver.bc.uwl.substitution

Class Substitution

java.lang.Object
  extended by com.sap.netweaver.bc.uwl.substitution.Substitution
All Implemented Interfaces:
IBaseSubstitution

public class Substitution
extends Object
implements IBaseSubstitution

 
 Definition of a substitution.
 Original user maintains the substitution definition for colleagues as substitutes to work on
 his or her various unfinished tasks.
 
        A substitution definition includes the following main attributes:
        - Substitution profile
  - Substitute user id
  - Mode of substitution
        - (optional) validity period
        - on/off status
 
 A substitution is mainly identified the substitution profile id, and the substitute id.
 Default is receive my tasks mode, switched on and no validity period. 
 
 


Constructor Summary
Substitution(String providerId, String substituteId)
          Create a substitution definition, specifying the provider id, and the substitute user id, with 'Receive Task' mode, effective immediately and no expiration date, and switched on by default, withOUT any substitution profile.
Substitution(String subProfileId, String substituteId, int substitutionMode, Date startDate, Date endDate, boolean switchedOn)
          Mainly to be used by UI.
Substitution(String providerId, String subProfileId, String substituteId)
          Create a substitution definition, specifying the provider id, and the substitute user id and substitution profile.
Substitution(String providerId, String systemId, String subProfileId, String substituteId)
          Create a substitution definition, specifying the provider id, system id(if any) and the substitute user id and substitution profile.
Substitution(String providerId, String systemId, String subProfileId, String substituteId, int substitutionMode, Date startDate, Date endDate, boolean switchedOn)
          Create a substitution definition, specifying the provider id, system id(if any) and the substitute user id and substitution profile, and with specific validity date range and substitution mode and switch on status.
 
Method Summary
 void appendMessage(String msg)
          append a message for this substitution
 Substitution createCopy()
           
static Substitution createInvalidInstance(String providerId, String systemId, String errMsg, int errCode)
          An easy api to create invalid substitution.
 int getCode()
          Get the error code
 Date getEndDate()
           
 String getMessage()
          Get a message for this substitution.
 String getProviderId()
           
 Date getStartDate()
           
 String getSubstituteId()
           
 int getSubstitutionMode()
           
 String getSubstitutionProfileId()
           
 String getSystemId()
           
 void invalidate()
          Set the substitution to invalid
 boolean isSwitchedOn()
           
 boolean isValid()
           
 void setCode(int code)
          Set the code corresponding to the message. 0 as default for success.
 void setMessage(String msg)
          Set a message for this substitution
 void setProviderId(String pId)
          Set the Id of the provider substitution manager
 void setSubstitutionProfileId(String subProfileId)
          Set the Id of the substitution profile
 void setSystemId(String systId)
          Set the Id of the provider substitution manager
 void switchOff()
          Set the substitution to OFF status.
 void switchOn()
          Set the substitution to ON status.
 void validate()
          Set the substitution to valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Substitution

public Substitution(String subProfileId,
                    String substituteId,
                    int substitutionMode,
                    Date startDate,
                    Date endDate,
                    boolean switchedOn)
Mainly to be used by UI. Create a substitution definition, with specific validity date range and substitution mode and switch on status.

Parameters:
subProfileId - Substitution profile id
substituteId - user id of substitute
substitutionMode - see IProviderSubstitutionManager.MODE_RECEIVETASKS or IProviderSubstitutionManager.MODE_TAKEOVER
startDate - Null if definition is to be effectively immediately
endDate - Null if no expiration date for the definition
switchedOn - True if switched on, otherwise false.

Substitution

public Substitution(String providerId,
                    String substituteId)
Create a substitution definition, specifying the provider id, and the substitute user id, with 'Receive Task' mode, effective immediately and no expiration date, and switched on by default, withOUT any substitution profile.

Parameters:
providerId - Provider id. Cannot be null.
substituteId - user id of substitute

Substitution

public Substitution(String providerId,
                    String subProfileId,
                    String substituteId)
Create a substitution definition, specifying the provider id, and the substitute user id and substitution profile. with 'Receive Task' mode, effective immediately and no expiration date, and switched on by default.

Parameters:
providerId - Provider id. Cannot be null.
subProfileId - Null for no substitution profile (that is all tasks)
substituteId - user id of substitute

Substitution

public Substitution(String providerId,
                    String systemId,
                    String subProfileId,
                    String substituteId)
Create a substitution definition, specifying the provider id, system id(if any) and the substitute user id and substitution profile. with 'Receive Task' mode, effective immediately and no expiration date, and switched on by default.

Parameters:
providerId - Provider id. Cannot be null.
systemId - System id of the provider. Can be null.
subProfileId - Null for no substitution profile (that is all tasks)
substituteId - user id of substitute

Substitution

public Substitution(String providerId,
                    String systemId,
                    String subProfileId,
                    String substituteId,
                    int substitutionMode,
                    Date startDate,
                    Date endDate,
                    boolean switchedOn)
Create a substitution definition, specifying the provider id, system id(if any) and the substitute user id and substitution profile, and with specific validity date range and substitution mode and switch on status.

Parameters:
providerId - Provider id. Cannot be null.
systemId - System id of the provider. Can be null.
subProfileId - Substitution profile id. Null for no substitution profile (that is all tasks)
substituteId - user id of substitute
substitutionMode - see IProviderSubstitutionManager.MODE_RECEIVETASKS or IProviderSubstitutionManager.MODE_TAKEOVER
startDate - Null if definition is to be effectively immediately
endDate - Null if no expiration date for the definition
switchedOn - True if switched on, otherwise false.
Method Detail

createCopy

public Substitution createCopy()

createInvalidInstance

public static Substitution createInvalidInstance(String providerId,
                                                 String systemId,
                                                 String errMsg,
                                                 int errCode)
An easy api to create invalid substitution. Invalid substitution has minimal data or dummy data for irrelevant fields.

Parameters:
providerId - Provider id.
systemId - System id of the provider.
message - Error message, if any.

getProviderId

public String getProviderId()
Specified by:
getProviderId in interface IBaseSubstitution
Returns:
Id of the provider substitution manager

setProviderId

public void setProviderId(String pId)
Set the Id of the provider substitution manager


getSystemId

public String getSystemId()
Specified by:
getSystemId in interface IBaseSubstitution
Returns:
Id of the system (if any) of the provider. Can be null

setSystemId

public void setSystemId(String systId)
Set the Id of the provider substitution manager


getSubstitutionProfileId

public String getSubstitutionProfileId()
Specified by:
getSubstitutionProfileId in interface IBaseSubstitution
Returns:
Substitution profile defined for this substitution.

setSubstitutionProfileId

public void setSubstitutionProfileId(String subProfileId)
Set the Id of the substitution profile

Specified by:
setSubstitutionProfileId in interface IBaseSubstitution

getSubstituteId

public String getSubstituteId()
Returns:
User id of the substitute

getSubstitutionMode

public int getSubstitutionMode()
Specified by:
getSubstitutionMode in interface IBaseSubstitution
Returns:
Substitution mode. Refer to IProviderSubstitutionManager.MODE_RECEIVETASKS or IProviderSubstitutionManager.MODE_TAKEOVER

getStartDate

public Date getStartDate()
Returns:
Start date of the validity period. Null if definition is effective immediately.

getEndDate

public Date getEndDate()
Returns:
End date of the validity period. Null if no expiration date for the definition.

isSwitchedOn

public boolean isSwitchedOn()
Returns:
True if definition is switched on, otherwise, false.

switchOn

public void switchOn()
Set the substitution to ON status.


switchOff

public void switchOff()
Set the substitution to OFF status.


isValid

public boolean isValid()
Specified by:
isValid in interface IBaseSubstitution
Returns:
True if definition is valid, otherwise, false.

validate

public void validate()
Set the substitution to valid


invalidate

public void invalidate()
Set the substitution to invalid


setMessage

public void setMessage(String msg)
Set a message for this substitution


appendMessage

public void appendMessage(String msg)
append a message for this substitution


getMessage

public String getMessage()
Get a message for this substitution. Return null if there is no message

Specified by:
getMessage in interface IBaseSubstitution

setCode

public void setCode(int code)
Set the code corresponding to the message. 0 as default for success.


getCode

public int getCode()
Get the error code

Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] UWLJWF [sap.com] tc/kmc/bc.uwl/api - EP-BC-UWL
[sap.com] UWLJWF [sap.com] tc/kmc/bc.uwl/api default EP-BC-UWL


Copyright 2011 SAP AG Complete Copyright Notice