Version: 4.0.1 +
Object Type: Action Object
The ClearCache is used to clear the cache of other objects. By default Futurama remembers all results of it's objects and retrieves them from the cache whenever these are requested again unchanged. In some cases however, it is desired that a new result is always generated. This holds for example when calling a webservice, generating random numbers (Formula Rand) or requesting the present date/time (Formula Now).
This property indicates under which condition the ClearCache is to be executed. If nothing is entered the ClearCache will always be executed. If a condition has been filled in the ClearCache will only be executed if the Condition is 'True'. In the property a Formula of type Boolean can be entered as well as a Fixed or a Reference to another object of type Boolean.
DebugLogMode (from version 4.1)
Indicates the level of detail of debug information that is logged when running a Futurama application (website, webservice, console application) to the trace, a logfile, a database etc. The possible values are:
- None: no debug information is logged
- Simple: only basic information is given
- Extended: in addition to the information in the Simple mode the values of all the properties of the object are shown
Possible values are True or False. If the value is False, then the object can only be used within the document where it is created. If the value is True, then also from other Futurama documents can be referred to this object. This means that changes in the object also affect the document in which is referred to this object. If the value is True and you attempt to move or delete the object, a warning will be given. To limit these warnings to a minimum it is recommended to set IsPublic to True only when necessary.
The value of this property can be 'True' or 'False'. If set to 'False' only the cache of the object defined at the property TargetObject will be emptied. If set to 'True' not only the cache of the TargetObject will be emptied but also the cache of objects that are Dependants of the TargetObject. This holds for direct Dependants as well as objects that depend on the TargetObject through other objects.
In this property a Reference can be made to the object whose cache needs to be emptied. It can be any of the following list:
The name of the object.
Here a comment can be entered. For example a short description of the object.
The unique identification number of the object. This number is automatically generated by Futurama on the moment of creation. This number can be used when searching for a certain object in the Find Window.
This is an automatic property. It will state that the cache of the TargetObject will be cleared.
In this example it is shown how a ClearCache can be used to always get the correct date and time.
Download the Futurama Document clearcache example.
- Open the XML-document which is contained in the zip-file in the Futurama Editor (Version 4.2.1 or later).
- Here an Action object can be seen which contains a ClearCache object. The property TargetObject of the ClearCache refers to the Formula 'Date Time'. This Formula uses the Formula Now() to generate the current date and time.
- First verify in the Result Window that the result of the Formula 'Date Time' is the time on which the Document was opened in the Editor.
- Wait a while and verify that the date and time are still the same! This is because the value is not recalculated but rather retrieved from the cache.
- In order to recalculate the Formula we have to empty the cache of the Formula.
- Do a rightclick on the ClearCache object or the Action containing the ClearCache and select Debug | Execute.
- Again verify the result of the Formula 'Date Time'. It can be seen that it has been updated.