Using the Quick Fix Feature

Procedure

  1. Type the code in the rule editor as if the entity, property, or rule function you want to use already exists. See Quick Fix Feature Options for some examples.

    You see a lightbulb icon in the left margin on any line where there are unknown references that you can configure using Quick Fix.

  2. To use the available Quick Fix options, click the lightbulb icon or press Ctrl+1. The options are explained in Quick Fix Feature Options:

Result

Quick Fix Feature Options
Unknown Reference Quick Fix Editor
Unqualified name. Example:
SomeName s;
A list of appropriate wizards appears so you can create a new concept, simple event, or time event. The wizard you select opens so you can define the entity.
Unqualified name followed by parentheses. Example:
SomeName()
A link to the rule function creation wizard appears. Click it to open the wizard and define the rule function.
Qualified name. Examples:
Rules.SomeName();
Concepts.SomeName s;
A Quick Fix option appears so you can automatically create the entity or rule function in the given folder.

The folder must already exist in the project.

Qualifier is a concept or event and reference is unknown. Example:
Concepts.Person person;
person.someProperty = "123"
A Quick Fix option appears with the name: Create a property definition in the entity’entityName’. Click the option to open the New Property Definition dialog, and configure the details of the property.

In the example, the someProperty property does not already exist as a property of Concepts.Person.

The following table explains the arguments.

Argument Notes
Object txns You can turn this argument into an Object[] within the rule function, for example:
Object[] array = txns;

The resulting array can be used to obtain useful data:

  • array[0] is a Concept[] containing all the Concept objects that:
    • have been created in the current RTC,
    • and have not been deleted.
  • array[1] is a Concept[] containing all the Concept objects that:
    • existed before the current RTC,
    • have been modified in the current RTC,
    • and have not been deleted.
  • array[2] is a Long[] containing the id of all the Concept objects that:
    • existed before the current RTC,
    • and have been deleted in the current RTC.
  • array[3] is a SimpleEvent[] containing all the SimpleEvent objects that:
    • are going to be added to the cache.
  • array[4] is a Long[] containing the id of all the Event objects that:
    • existed before the current RTC, or arrived and started the RTC,
    • and have been deleted in the current RTC.
int errorType Value can be one of:

-1 for errors happening during database operations.

-2 for errors happening when sending an event.

int errCode The error code, which is dependent on errorType:
  • For database related errors:
    • The error code as returned by SQLException, if available
    • Else -100 if TIBCO BusinessEvents determines that the database is not available
    • Else -200, which means that this is an unknown error
  • For sent event errors, the value is -1, meaning an internal error condition.
String errMsg The associated exception message.
long retryCount The number of times this transaction has been retried before the present call to the callback.