Add Triggers to Determine When Your Pipelines Run
About Triggers
Triggers control pipeline and component activation based on the incoming request (caller plus the input data).
-
Triggers can be specified for any/all of the AutoClassifier components and pipelines.
-
By default, all of the triggers that are listed in the UI are called.
-
You can choose to select one or more filters within the features that you add.
Specify Trigger Settings
Use the following steps to specify your pipeline or component trigger settings.
- On the Pipeline page, select a your pipeline and expand the Trigger section:
- To turn on triggers, click Enable. You must enable turn on this setting before you can select any specific Triggers. If this is not enabled, the Pipeline is always called.
- Triggers (Optional): If no specific triggers are selected, the Pipeline is always called. Select one or more specific triggers and if the trigger evaluates to True, the pipeline is called:
Trigger Description AutoClassifier Annotator This is triggered when scheduled annotation service from the SharePoint add-in is initiated.
For example, when an admin configures the annotation scheduler for the SharePoint add-in and specifies the scheduled time when annotation occurs, this trigger is initiated when the scheduled time is met.
Connector DocLoader This is triggered when the Connectivity Hub doc-loader service is called.
For example, when an admin is defining the data to be extracted and pushed into their target with doc-loader to download a specific item from the content source, this trigger is initiated when the doc-loader request is sent.
Connector Test Bench This is triggered when Connectivity Hub Test Bench is used for a content source that is integrated with AutoClassifier.
For example, when an admin integrates AutoClassifier and Connectivity Hub to return metadata to a content source from pipeline stages, then in Connectivity Hub, the admin selects the content source for testing in Test Bench, this trigger is initiated when the test is started.
Suggestions This is triggered when suggestions are generated by through the taxonomy editor.
For example, when an admin Extends their taxonomy to enrich query results, this trigger is initiated when the term suggestion is generated.
Connector Crawler This is triggered when a crawl from the Connectivity Hub crawl service is initiated for a content source that is integrated with AutoClassifier.
For example, when an admin integrates AutoClassifier and Connectivity Hub to return metadata to a content source from pipeline stages, then in Connectivity Hub, the admin starts a crawl task, this trigger is initiated when the crawl is started.
Custom This is triggered when a customized script is triggered. For example, when an admin configures the script component, this trigger is initiated whenever the specified trigger parameters are met. Playback or Testing This is triggered when pipeline testing is used for the specified pipeline. For example, when an admin selects Pipeline Testing and specifies the pipeline or component that you configured, this trigger is initiated when the test is started. SharePoint Crawler This is triggered when crawling mode is used for the SharePoint on-premise add-in. For example, when an admin enables crawling mode, this trigger is initiated when a SharePoint on-premise crawl is started. - Trigger Script (optional):
Enter a C# or a VB script.
- Return True in the trigger script to run the pipeline stage.
- Return False to skip running the pipeline stage.
Configure Your Triggers Using Scripts
- On the Pipeline page, select a your pipeline and expand the Trigger section.
- Trigger is enabled: Click. You must select Trigger is enabled before you can make any selections/entries.
- In the Trigger Script section, select C# or VB.NET as the script language.
- Type in the script.
- Compile: Click to verify the validity of the script.
See the following scripting examples:
Example: Retrieving an Item Property

To get an item property, use the generic GET
method on item object:
string propertyValue = item.Get<string>("propertyName");
Dim propertyValue As String = item.[Get](Of String)("propertyName")
Example: Property Values
Example: Item Raw Data

Raw data can be retrieved as a byte buffer using the RawData
property.
byte[] content = item.RawData;
Dim content As Byte() = item.RawData
Example: Logging

Use static methods to write entries into the log at different levels:
Log.Debug("Debug message");
Log.Info("Info message");
Log.Warning("Warning message");
Log.Error("Error message");
Log.Debug("Debug message");
Log.Info("Info message");
Log.Warning("Warning message");
Log.[Error]("Error message");
- Assemblies and namespaces: Click
to define the assemblies and namespaces to import.
Example: Prevent calls for deleted items

If you want to exclude deleted or skipped items from being sent from Connectivity Hub to AutoClassifier, use the following script:
var isDeletedItemRequestFromCH = item.Get<bool>("IsDeleted");
if (isDeletedItemRequestFromCH)
return false;
Dim isDeletedItemRequestFromCH = item.[Get](Of Boolean)("IsDeleted")
If isDeletedItemRequestFromCH Then Return False