Package com.apgar.common.lib.trigger
Class DefaultValueTrigger
java.lang.Object
com.orchestranetworks.schema.trigger.TableTrigger
com.apgar.common.lib.trigger.DefaultValueTrigger
public class DefaultValueTrigger
extends com.orchestranetworks.schema.trigger.TableTrigger
Table trigger to fill a String field (path as a parameter) with a default value (as a parameter).
The trigger is defined as follows for the table it is applied on in the XSD of its dataset.
<xs:complexType name="SampleTable_Type">
<xs:annotation>
<xs:documentation xml:lang="en-US">
<osd:label>Sample Table</osd:label>
</xs:documentation>
<xs:appinfo>
<osd:table>...</osd:table>
<osd:trigger class="com.apgar.common.lib.trigger.DefaultValueTrigger">
<defaultValue>value</defaultValue>
<pathToField>./pathToField</pathToField>
</osd:trigger>
</xs:appinfo>
</xs:annotation>
</xs:complexType>
- Author:
- APGAR Consulting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the string value to be set to the fieldReturns the path of the field to be set as a stringvoidhandleBeforeCreate(com.orchestranetworks.schema.trigger.BeforeCreateOccurrenceContext context) voidhandleNewContext(com.orchestranetworks.schema.trigger.NewTransientOccurrenceContext context) voidsetDefaultValue(String defaultValue) Sets the default string value which the field the trigger is applied on will be set tovoidsetPathToField(String pathToField) Sets the path of the fieldvoidsetup(com.orchestranetworks.schema.trigger.TriggerSetupContext context) Performs type checkMethods inherited from class com.orchestranetworks.schema.trigger.TableTrigger
handleAfterCreate, handleAfterDelete, handleAfterModify, handleBeforeDelete, handleBeforeModify, handleBeforeTransactionCancel, handleBeforeTransactionCommit, zza, zza
-
Constructor Details
-
DefaultValueTrigger
public DefaultValueTrigger()
-
-
Method Details
-
handleNewContext
public void handleNewContext(com.orchestranetworks.schema.trigger.NewTransientOccurrenceContext context) - Overrides:
handleNewContextin classcom.orchestranetworks.schema.trigger.TableTrigger
-
handleBeforeCreate
public void handleBeforeCreate(com.orchestranetworks.schema.trigger.BeforeCreateOccurrenceContext context) throws com.orchestranetworks.service.OperationException - Overrides:
handleBeforeCreatein classcom.orchestranetworks.schema.trigger.TableTrigger- Throws:
com.orchestranetworks.service.OperationException
-
setup
public void setup(com.orchestranetworks.schema.trigger.TriggerSetupContext context) Performs type check- Specified by:
setupin classcom.orchestranetworks.schema.trigger.TableTrigger
-
getDefaultValue
Returns the string value to be set to the field- Returns:
- the string value to be set to the field
-
setDefaultValue
Sets the default string value which the field the trigger is applied on will be set to- Parameters:
defaultValue- String value to be set
-
getPathToField
Returns the path of the field to be set as a string- Returns:
- the formatted String path of the field set by the trigger
-
setPathToField
Sets the path of the field- Parameters:
pathToField- path of the field to be set
-