Event

Whenever iKnowBase store or updates a document (an information object), file uploads or a metadata object (user, group, acl) in the content repository, it can send a notification about this to the outside world. Such a notification is called an event, and it is implemented by having iKnowBase to call a custom PL/SQL procedure.

The event definition specifies which procedure should be called and under what conditions the procedure should be called.

An event is an action performed when certain operations like insert and update are carried out on a given object. For document, in addition to the operations, the document can have some conditions that need to be satisfied in order to execute the event.

Document Event Properties

This section describes the properties of a document event, as shown on the corresponding Edit pane.

Property Description
Subsystem

The subsystem the profile belongs to

Event for

Set automatically to documents.

Name

Type a name for the event.

Sort Key

A number that defines the order in which several events are sorted. If a document operation triggers several events, the event with the lowest sort key value is executed first.

Description

Type a description of the event.

Event procedure

Select the database procedure that will be called when the event triggers.

Information types

Select the information types that this event applies to.

Operation

Select which operations this event applies to, and specify whether the event is enabled or not.

The set of operations that this event applies to:

  • Insert applies when a new document is inserted
  • Update applies when an existing document is updated
  • Delete applies when an existing document is deleted
  • Enable applies to enabling or disabling a event
Flexfield 1, 2 and 3

A user selectable text value that is sent to the event procedure.

Define condition

You can choose between two types of parameters:

  • SQL parameter: Parameters defined as SQL parameters
  • Attribute: iKnowBase attributes, used to set constant values in the query.

When the parameter is selected, you must save before you can set any values.

Actions

Delete the parameter by clicking the icon

Attribute

Displays the names of the selected attributes to use as conditions for the event.

Disabled?

You can for debugging reasons disable attributes.

sql-clause

For performance reasons and only for advanced users: Defines how the query condition is built (IN or EXISTS)

Condition

Select the appropriate conditions for the selected attributes. The conditions depend on the type of attribute.

Note: You cannot select a condition for parameters.

Value

Select or enter the appropriate values for the selected attributes. Available options depends on the attribute/parameter type.

Not applicable to SQL parameters.

Run Batch

You can run an event in batch mode. It will select all documents matching the conditions set for the event.
In your custom event procedure the eventmode will have the value ‘BATCH’. Make sure you know the consequences before running an event as a batch job.

Property Description
Schedule name

If running, if will display the schedule name here.

Last runned date

Will display the last time if was runned as a batch job.

DocumentId / title

Displays a list of documents that correspond the conditions for the event.

Metadata Event Properties

This section describes the properties of a metadata event, as shown on the corresponding Edit pane.

Property Description
Subsystem

The subsystem the profile belongs to

Event for

Enter what type of object you define the event for. You can choose between

  • Users. No conditions can be defined.
  • Access control lists. No conditions can be defined.
  • Groups. No conditions can be defined.
  • Upload event. Will be triggered when uploading a new document to iKnowBase (e.g WebDav or DragAndDrop-function). No conditions can be defined.
Name

Type a name for the event.

Sort Key

Type a sort key.

A number that defines the order in which several events are sorted. If a document operation triggers several events, the event with the lowest sort key value is executed first.

Description

Type a description of the event.

Event procedure

Select the database procedure that will be called when the event triggers.

Operation

Select which operations this event applies to, and specify whether the event is enabled or not.

The set of operations that this event applies to:

  • Insert applies when a new row is inserted
  • Update applies when an existing row is updated
  • Delete applies when an existing row is deleted
  • Enable do activate/enable the event
Guid

Displays a globally unique identifier number for this component. This property appears after you save a component. You cannot update the information of this property.

Id

Displays a unique identifier number for this component. This property appears after you save a component. You cannot update the information of this property.

Created

Displays when the component was created and by whom it was created.

Updated

Displays when the component was last updated and by whom it was updated.

Indexing event(SOLR) Properties

This section describes the properties of a SOLR event, as shown on the corresponding Edit pane. The purpose of a SOLR event is to notify the content indexer about documents that should be indexed by Apache Solr search engine. In contrast to a regular document event, the result from a SOLR event will always be a AQ-message notifying the content indexer to either update or delete the document in Apache Solr. The event procedure will always be the same, but you can create a custom function as a replacement of ikb_solr.get_document function. A changelog is managed by the event and you do have administrative functions to maintain the message queue, exception queue, changelog and document list for the event.

Property Description
Subsystem

The subsystem the profile belongs to

Event for

Set automatically to Indexing Event (SOLR).

Name

Type a name for the event.

External key

Type a unique external key for the event.

Sort Key

A number that defines the order in which several events are sorted. If a document operation triggers several events, the event with the lowest sort key value is executed first.

Description

Type a description of the event.

Custom function

The content indexer calls an iKnowBase function to retrieve the document for indexing. This function can be replaced by a custom function instead if you need a specialized version of the function.

Information types

Select the information types that this event applies to.

Operation

Enable applies to enabling or disabling a event

Solr Configuration

Select the Solr configuration set. Try to use the same Solr configuration between different events.

Flexfield 1, 2 and 3

A user selectable name=text syntax that is sent to the content indexer as a Solr field. The flexfields have these options/formats :

  • <name>=<value> e.g subtype=NewsItem. If the name already exists in the value set to the content indexer, it will be replaced by the value given here.
  • <name>={solrfield} e.g mycard_qc={title}. {title} will be retrieved from an existing value in the Solr configuration. Can be useful to copy values to e.g query completion fields.
Define condition

You can choose between two types of parameters:

  • SQL parameter: Parameters defined as SQL parameters
  • Attribute: iKnowBase attributes, used to set constant values in the query.

When the parameter is selected, you must save before you can set any values.

Actions

Delete the parameter by clicking the icon

Attribute

Displays the names of the selected attributes to use as conditions for the event.

Disabled?

You can for debugging reasons disable attributes.

sql-clause

For performance reasons and only for advanced users: Defines how the query condition is built (IN or EXISTS)

Condition

Select the appropriate conditions for the selected attributes. The conditions depend on the type of attribute.

Note: You cannot select a condition for parameters.

Value

Select or enter the appropriate values for the selected attributes. Available options depends on the attribute/parameter type.

Not applicable to SQL parameters.

Guid

Displays a globally unique identifier number for this component. This property appears after you save a component. You cannot update the information of this property.

Id

Displays a unique identifier number for this component. This property appears after you save a component. You cannot update the information of this property.

Created

Displays when the component was created and by whom it was created.

Updated

Displays when the component was last updated and by whom it was updated.

Index queue status

To administre the index process for the documents matching the event, you will find several functions to do bulk operations against Apache Solr. First part of the screen gives an overview over number of indexed documents, number of messages in queue/exception queue, number of documents in the changelog and a notification if metadata defined as part of the Solr configuration has changed for the document but not in the index. All of these notifications and more can be handle from here.

Property Description
Status of index queue and changelog

Prints info about the queue, changelog and running jobs for the event

Available actions for this event

The actions you can do will only available if it’s neccecery. (e.g no need for a Purge changelog if the changelog is empty):

  • (Re)index all documents? The job will queue all documents in the event for indexing. Documents that no longer meets the event criterias will be removed from the index.
  • (Re)index a single document? The job select a random document for reindexing.
  • Remove all documents from Apache Solr index? The job will queue all documents in the event for removal from the index. It any other events also handle the document, it will not be removed.
  • Add new documents? The job will queue all new documents not already in the changelog for the event.
  • Remove documents from Apache Solr that no longer exists for this event?
  • Reindex documents affected by metadata changes? A document can be tagged to e.g a dimension. If the dimension label is changed, the value should also be populated to the index if it exists in the Solr configuration.
  • Resend all documents in exception queue? Messages can be moved to a exception queue if e.g the Apache Solr server is down. Run this job is you want to move the messages back to the message queue.
  • Delete all documents in exception queue? Messages can be moved to a exception queue if e.g the Apache Solr server is down. Run this job is you want to remove the exception messages.
  • Purge the message queue? The job will remove all queued messages
  • Purge the changelog? The job will remove all entries from the changelog. If you purge the changelog, the documents will remain in Apache Solr.
  • Purge the event log? The job will remove all entries from the event log.
Index failures – List of documents failed to index/reindex

If the exception queue has any entries, they will be displayed here. You can resend or delete a single entry.

Indexed documents

Used for a SOLR event and display the first 200 documents defined for the event.

Property Description
Document field

Will display Document ID, title, information type and changed date.

Index data

Will display index date.

Multiple events

Used for a SOLR event and displays the first 200 documents defined for the event, but ‘owned’ by another event. You should try to avoid events matching the same documents. You can let this event take ownership over the documents.

Property Description
Document field

Will display Document ID, title, information type and changed date.

Index data

Will display index date, event ID and event name.

View batch log

You can create debug/warning messages in your custom event procedure.
Use the procedure portlet_manage_event.log_batch( <eventGuid>, ' <text>') to log messages. All messages are shown here.

Property Description
Schedule name

Displays the schedule name here.

Last runned date

Will display the last time if was runned as a batch job.

View a log from the last batch run

Will display the last time if was runned as a batch job.