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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the string value to be set to the field
    Returns the path of the field to be set as a string
    void
    handleBeforeCreate(com.orchestranetworks.schema.trigger.BeforeCreateOccurrenceContext context)
     
    void
    handleNewContext(com.orchestranetworks.schema.trigger.NewTransientOccurrenceContext context)
     
    void
    setDefaultValue(String defaultValue)
    Sets the default string value which the field the trigger is applied on will be set to
    void
    setPathToField(String pathToField)
    Sets the path of the field
    void
    setup(com.orchestranetworks.schema.trigger.TriggerSetupContext context)
    Performs type check

    Methods inherited from class com.orchestranetworks.schema.trigger.TableTrigger

    handleAfterCreate, handleAfterDelete, handleAfterModify, handleBeforeDelete, handleBeforeModify, handleBeforeTransactionCancel, handleBeforeTransactionCommit, zza, zza

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultValueTrigger

      public DefaultValueTrigger()
  • Method Details

    • handleNewContext

      public void handleNewContext(com.orchestranetworks.schema.trigger.NewTransientOccurrenceContext context)
      Overrides:
      handleNewContext in class com.orchestranetworks.schema.trigger.TableTrigger
    • handleBeforeCreate

      public void handleBeforeCreate(com.orchestranetworks.schema.trigger.BeforeCreateOccurrenceContext context) throws com.orchestranetworks.service.OperationException
      Overrides:
      handleBeforeCreate in class com.orchestranetworks.schema.trigger.TableTrigger
      Throws:
      com.orchestranetworks.service.OperationException
    • setup

      public void setup(com.orchestranetworks.schema.trigger.TriggerSetupContext context)
      Performs type check
      Specified by:
      setup in class com.orchestranetworks.schema.trigger.TableTrigger
    • getDefaultValue

      public String getDefaultValue()
      Returns the string value to be set to the field
      Returns:
      the string value to be set to the field
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
      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

      public String 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

      public void setPathToField(String pathToField)
      Sets the path of the field
      Parameters:
      pathToField - path of the field to be set