How to set a Run Location of "Force Server" or "Force Local" when running a Data Function via API

How to set a Run Location of "Force Server" or "Force Local" when running a Data Function via API

book

Article ID: KB0075975

calendar_today

Updated On:

Products Versions
Spotfire Analyst All supported versions

Description

This article explains how to set a Run Location of "Force Server" or "Force Local" when running a Spotfire Data Function via API.

Issue/Introduction

How to set a Run Location of "Force Server" or "Force Local" when running a Data Function via API

Environment

All supported environments

Resolution

You can set this programmatically in the "DataFunctionDefinitionBuilder" by adding a key to the "DataFunctionDefinitionBuilder.Settings" property, using the key "forcelocalengine" or "forceserverengine" depending on which behavior you want to force.

The following example sets a Run Location of "Force Server":

==========
DataFunctionDefinitionBuilder dfdb = new DataFunctionDefinitionBuilder("My Data Function", DataFunctionExecutorTypeIdentifiers.TERRScriptExecutor);
// other data function parameters go here
dfdb.Settings.Add("forceserverengine", null);  
DataFunctionDefinition dfd = dfdb.Build();
==========


 

Additional Information

The SDK also provides some examples:

SpotfireDeveloper.DataFunctionsExample\ExampleExecutorCredentialsKey.cs