com.sap.netweaver.bc.uwl.substitution

Class AssignedSubstitution

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.substitution.AssignedSubstitution
All Implemented Interfaces:
IBaseSubstitution

public class AssignedSubstitution
extends Object
implements IBaseSubstitution

Assigned Substitution. The user himself/herself can be assigned as a substitute for other colleague(s)


Constructor Summary
AssignedSubstitution(String subProfileId, String originalUserId, int substitutionMode, boolean alreadySubstituted)
          Mainly to be used by UI.
AssignedSubstitution(String providerId, String subProfileId, String originalUserId, int substitutionMode, boolean alreadySubstituted)
          An assigned substitution with details of the assignment.
AssignedSubstitution(String providerId, String systemId, String subProfileId, String originalUserId, int substitutionMode, boolean alreadySubstituted)
          An assigned substitution with details of the assignment.
 
Method Summary
 void appendMessage(String msg)
          append a message for this substitution
 AssignedSubstitution createCopy()
           
static AssignedSubstitution createInvalidInstance(String providerId, String systemId, String errMsg)
          An easy api to create invalid assigned substitution.
 String getMessage()
          Get a message for this substitution.
 String getOriginalUserId()
           
 String getProviderId()
           
 int getSubstitutionMode()
           
 String getSubstitutionProfileId()
           
 String getSystemId()
           
 boolean hasAlreadySubstituted()
           
 void invalidate()
          Set the substitution to invalid
 boolean isValid()
           
 void setMessage(String msg)
          Set a message for this substitution
 void setProviderId(String providerId)
          Set the provider Id
 void setSubstitutionProfileId(String subProfileId)
          Set the Id of the substitution profile
 void setSystemId(String systemId)
          Set the system Id
 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

AssignedSubstitution

public AssignedSubstitution(String subProfileId,
                            String originalUserId,
                            int substitutionMode,
                            boolean alreadySubstituted)
Mainly to be used by UI. An assigned substitution with details of the assignment.

Parameters:
subProfileId - Substitution profile id. Null for no substitution profile (that is all tasks)
originalUserId - User id of the colleague assigning this substitution
substitutionMode - Substitution mode
alreadySubstituted - If the user has already substituted for the substitution. Always true if the mode is "RECEIVE TASKS". When mode is "TAKE OVER", return true if the user has already taken over, otherwise, false.

AssignedSubstitution

public AssignedSubstitution(String providerId,
                            String subProfileId,
                            String originalUserId,
                            int substitutionMode,
                            boolean alreadySubstituted)
An assigned substitution with details of the assignment.

Parameters:
providerId - Provider id. Cannot be null.
subProfileId - Substitution profile id. Null for no substitution profile (that is all tasks)
originalUserId - User id of the colleague assigning this substitution
substitutionMode - Substitution mode
alreadySubstituted - If the user has already substituted for the substitution. Always true if the mode is "RECEIVE TASKS". When mode is "TAKE OVER", return true if the user has already taken over, otherwise, false.

AssignedSubstitution

public AssignedSubstitution(String providerId,
                            String systemId,
                            String subProfileId,
                            String originalUserId,
                            int substitutionMode,
                            boolean alreadySubstituted)
An assigned substitution with details of the assignment.

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)
originalUserId - User id of the colleague assigning this substitution
substitutionMode - Substitution mode
alreadySubstituted - If the user has already substituted for the substitution. Always true if the mode is "RECEIVE TASKS". When mode is "TAKE OVER", return true if the user has already taken over, otherwise, false.
Method Detail

createInvalidInstance

public static AssignedSubstitution createInvalidInstance(String providerId,
                                                         String systemId,
                                                         String errMsg)
An easy api to create invalid assigned substitution.

Parameters:
providerId - Provider id.
systemId - System id of the provider.

createCopy

public AssignedSubstitution createCopy()

getProviderId

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

setProviderId

public void setProviderId(String providerId)
Set the provider Id


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 systemId)
Set the system Id


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

getOriginalUserId

public String getOriginalUserId()
Returns:
User id of the original user

getSubstitutionMode

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

hasAlreadySubstituted

public boolean hasAlreadySubstituted()
Returns:
Return true if the substitute has already substituted the tasks, otherwise false.

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


Copyright 2006 SAP AG Complete Copyright Notice