Flow element update

Entry points for Obsolete and Obsolete property

getUpdatedValueForProperty( s : Switch, inTag : String ) : Array
getUpdatedValueForConnectionProperty( s : Switch, c : Connection, inTag : String ) : Array

Here,

"inTag" is the tag of the property for which new value was requested.

"s" is the Switch object representing the old flow element.

"c" is the Connection object representing the old connection element.

The value returned is an array of two strings where the first item is the new value and the second item is the type of this value (which means the editor which virtually "was used" to set the value).

If the entry point is not implemented or if the array is empty then the corresponding "inTag" property will remain unchanged.

If the array does not contain two items then a warning message will be logged and the property will remain unchanged.

Additionally, if the array contains two items but they cannot be used to set the new property value, a warning message will be logged and the property will remain unchanged.

The reasons why the specified value cannot be used as a new property value are:
  • the property does not support such kind of editor
  • the value type does not correspond to the property type
  • the drop-down value is not in the list of available drop-down values and so on
The list of editors available are:
  1. EditorSingleLineText
  2. EditorPassword
  3. EditorNumber
  4. EditorRational
  5. EditorHoursAndMinutes
  6. EditorDate
  7. EditorDateAndTime
  8. EditorNoYesList
  9. EditorDropdownList
  10. EditorLiteral
  11. EditorChooseFile
  12. EditorChooseFolder
  13. EditorRegularExpression
  14. EditorFileType
  15. EditorSelectFromLibrary
  16. EditorMultiLineText
  17. EditorScriptExpression
  18. EditorSingleLineTextWithVariables
  19. EditorMultiLineTextWithVariables
  20. EditorConditionWithVariables
  21. EditorFilePatterns
  22. EditorFolderPatterns
  23. EditorFileTypes
  24. EditorStringList
  25. EditorSelectManyFromLibrary
  26. EditorExternalEditor
  27. EditorDatabaseQuery
They can be accessed in the script by using the constants like s.EditorName.
For the EditorLiteral, you can use the following literals as the value (first item of the resulting array):
  1. LiteralDefault
  2. LiteralNone
  3. LiteralAutomatic
  4. LiteralNoFiles
  5. LiteralAllFiles
  6. LiteralAllOtherFiles
  7. LiteralNoFolders
  8. LiteralAllFolders
  9. LiteralAllOtherFolder

They can be accessed in the script by using the constants like s.LiteralName.

For example:

function getUpdatedValueForProperty( s : Switch, inTag : String ) : Array

{
         var theResArray = new Array();
                  if( inTag == "dataset" )
         {
                theResArray.push( "Xml" );
                theResArray.push( s.EditorSingleLineText );
         }
         else if( inTag == "dataModel" )
         {
                theResArray.push( "XML" );
                theResArray.push( s.EditorDropdownList );
         }         else if( inTag == "locationPath" )
         {
                theResArray.push( s.LiteralNone );
                theResArray.push( s.EditorLiteral );
         }           return theResArray;
}

function getUpdatedValueForConnectionProperty( s : Switch, c : Connection, inTag : String ) : Array

{
         var theResArray = new Array();
         if( inTag == "Name" )
         {
                if( c.getName().isEmpty() )
                {
                        theResArray.push( "New name" );
                        theResArray.push( s.EditorSingleLineText );
                }
         }
         else if( inTag == "Error" )
         {
                if( !c.allowsSuccess() && !c.allowsError() )
                {
                        theResArray.push( "Yes" );
                        theResArray.push( s.EditorNoYesList );
                }
         }
           return theResArray;
}