org.kuali.rice.krms.impl.peopleflow
Class PeopleFlowActionTypeService

java.lang.Object
  extended by org.kuali.rice.kns.datadictionary.validation.AttributeValidatingTypeServiceBase
      extended by org.kuali.rice.krms.impl.type.KrmsTypeServiceBase
          extended by org.kuali.rice.krms.impl.peopleflow.PeopleFlowActionTypeService
All Implemented Interfaces:
ActionTypeService, RemotableAttributeOwner

public class PeopleFlowActionTypeService
extends KrmsTypeServiceBase
implements ActionTypeService

ActionTypeService implementation for PeopleFlow actions. The loaded Actions will place or extend an attribute in the EngineResults whose key is "peopleFlowSelected" and value is a String of the form (using EBNF-like notation):

    (notification|approval):<peopleFlowId>{,(notification|approval):<peopleFlowId>}

An example value with two people flow actions specified would be:

    "A:1000,F:1001"


Nested Class Summary
static class PeopleFlowActionTypeService.Type
          enum used to specify the action type to be specified in the vended actions.
 
Nested classes/interfaces inherited from class org.kuali.rice.kns.datadictionary.validation.AttributeValidatingTypeServiceBase
AttributeValidatingTypeServiceBase.TypeAttributeDefinition, AttributeValidatingTypeServiceBase.TypeAttributeValidationException
 
Field Summary
static String ATTRIBUTE_FIELD_NAME
           
static String NAME_ATTRIBUTE_FIELD
           
 
Method Summary
static PeopleFlowActionTypeService getInstance(PeopleFlowActionTypeService.Type type)
          Factory method for getting a PeopleFlowActionTypeService
 PeopleFlowService getPeopleFlowService()
           
 Action loadAction(ActionDefinition actionDefinition)
          Load the Action given the ActionDefinition
 void setConfigurationService(ConfigurationService configurationService)
          inject the ConfigurationService to use internally.
 void setPeopleFlowService(PeopleFlowService peopleFlowService)
          inject the PeopleFlowService to use internally.
 RemotableAttributeField translateTypeAttribute(KrmsTypeAttribute inputAttribute, KrmsAttributeDefinition attributeDefinition)
          Translate a KrmsTypeAttribute into a RemotableAttributeField.
 List<RemotableAttributeError> validateAttributes(String krmsTypeId, Map<String,String> attributes)
          Attributes must include a ATTRIBUTE_FIELD_NAME
 List<RemotableAttributeError> validateAttributesAgainstExisting(String krmsTypeId, Map<String,String> newAttributes, Map<String,String> oldAttributes)
          This method validates the passed in attributes for a krmsTypeId generating a List of RemotableAttributeErrors.
 
Methods inherited from class org.kuali.rice.krms.impl.type.KrmsTypeServiceBase
getAttributeFields, getDataDictionaryRemoteFieldService, getTypeAttributeDefinitions, sortFields, validateNonDataDictionaryAttribute
 
Methods inherited from class org.kuali.rice.kns.datadictionary.validation.AttributeValidatingTypeServiceBase
createErrorString, extractErrorsFromGlobalVariablesErrorMap, getAttributeErrorLabel, getAttributeFormatter, getAttributeValidatingExpression, getConfigurationService, getDataDictionaryService, getDictionaryValidationService, validateAttributeFormat, validateAttributeRequired, validateDataDictionaryAttribute, validatePrimitiveAttributeFromDescriptor, validateReferencesExistAndActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krms.framework.type.RemotableAttributeOwner
getAttributeFields
 

Field Detail

ATTRIBUTE_FIELD_NAME

public static final String ATTRIBUTE_FIELD_NAME
See Also:
Constant Field Values

NAME_ATTRIBUTE_FIELD

public static final String NAME_ATTRIBUTE_FIELD
See Also:
Constant Field Values
Method Detail

getInstance

public static PeopleFlowActionTypeService getInstance(PeopleFlowActionTypeService.Type type)
Factory method for getting a PeopleFlowActionTypeService

Parameters:
type - indicates the type of action that the returned PeopleFlowActionTypeService will produce
Returns:
a PeopleFlowActionTypeService corresponding to the given PeopleFlowActionTypeService.Type.

setConfigurationService

public void setConfigurationService(ConfigurationService configurationService)
inject the ConfigurationService to use internally.

Parameters:
configurationService -

loadAction

public Action loadAction(ActionDefinition actionDefinition)
Description copied from interface: ActionTypeService
Load the Action given the ActionDefinition

Specified by:
loadAction in interface ActionTypeService
Parameters:
actionDefinition -
Returns:
Action as defined by the given ActionDefinition
Throws:
RiceIllegalArgumentException - is actionDefinition is null, attributes do not contain the ATTRIBUTE_FIELD_NAME key, or the NAME_ATTRIBUTE_FIELD key.

translateTypeAttribute

public RemotableAttributeField translateTypeAttribute(KrmsTypeAttribute inputAttribute,
                                                      KrmsAttributeDefinition attributeDefinition)
Description copied from class: KrmsTypeServiceBase
Translate a KrmsTypeAttribute into a RemotableAttributeField. Override this method to provide custom translation of certain attributes.

Overrides:
translateTypeAttribute in class KrmsTypeServiceBase
Parameters:
inputAttribute - the KrmsTypeAttribute to translate
attributeDefinition - the KrmsAttributeDefinition for the given inputAttribute
Returns:
a RemotableAttributeField for the given inputAttribute

validateAttributes

public List<RemotableAttributeError> validateAttributes(String krmsTypeId,
                                                        Map<String,String> attributes)
                                                 throws RiceIllegalArgumentException
Attributes must include a ATTRIBUTE_FIELD_NAME

Specified by:
validateAttributes in interface RemotableAttributeOwner
Overrides:
validateAttributes in class KrmsTypeServiceBase
Parameters:
krmsTypeId - the people flow type identifier. Must not be null or blank.
attributes - the attributes to validate. Cannot be null.
Returns:
Throws:
RiceIllegalArgumentException - if required attribute ATTRIBUTE_FIELD_NAME is not in the given attributes

validateAttributesAgainstExisting

public List<RemotableAttributeError> validateAttributesAgainstExisting(String krmsTypeId,
                                                                       Map<String,String> newAttributes,
                                                                       Map<String,String> oldAttributes)
                                                                throws RiceIllegalArgumentException
Description copied from interface: RemotableAttributeOwner

This method validates the passed in attributes for a krmsTypeId generating a List of RemotableAttributeErrors. This method used the oldAttributes to aid in validation. This is useful for validating "new" or "updated" attributes.

Specified by:
validateAttributesAgainstExisting in interface RemotableAttributeOwner
Overrides:
validateAttributesAgainstExisting in class KrmsTypeServiceBase
Parameters:
krmsTypeId - the people flow type identifier. Must not be null or blank.
newAttributes - the kim type attributes to validate. Cannot be null.
oldAttributes - the old attributes to use for validation. Cannot be null.
Returns:
any errors that are discovered during validation. Will not return null.
Throws:
RiceIllegalArgumentException

getPeopleFlowService

public PeopleFlowService getPeopleFlowService()
Returns:
the configured PeopleFlowService

setPeopleFlowService

public void setPeopleFlowService(PeopleFlowService peopleFlowService)
inject the PeopleFlowService to use internally.

Parameters:
peopleFlowService -


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.