ForeExecResult ForeExecAtomic(ForeExecAtomicArg tArg)
tArg. Operation execution parameters.
The ForeExecAtomic operation executes Fore methods when working in integration services.
Integration services are third-party services that request data from platform repositories. The ForeExecAtomic operation connects to repository using a special integration user, executes Fore method, returns method execution result, and closes repository connection.
To execute the ForeExecAtomic operation, the repository should be prepared as follows:
In repository connection description set the EnableForeExecAtomic setting to true.
Using the PP.Util utility with the save_creds parameters and specifying the MBCACHE keyword, save credentials of schema owner or any user who has permissions to read repository system tables. The saved credentials are used to connect to database and read the system table with integration users that will be cached in BI server memory on the first execution of the ForeExecAtomic operation.
Using the PP.Util utility with the save_integration_user parameters, generate token for integration user and save technological account credentials to connect to repository by using the ForeExecAtomic operation.
After executing the specified operations one can use the ForeExecAtomic operation. To execute the operation, in the tArg.token field specify the integration user token obtained on executing the save_integration_user operation, in the tArg.metabaseId field specify repository identifier, and in the tArg.objKey and tArg.foreArg fields specify unit/assembly key and parameters of executed Fore method.
The operation returns the Fore method execution result.
Below is the example of executing Fore method by the integration user who should be saved for the repository. The request contains integration user token, repository identifier, unit key, and parameters of executed method. The response contains method execution result.
{
"ForeExecAtomic" :
{
"tArg" :
{
"token" : "{BD8D4E02-FA2A-405B-9938-8DB97087C7D8}",
"metabaseId" : "TestRepository",
"objKey" : "20109",
"foreArg" :
{
"methodName" : "TestAtomic",
"args" :
{
"it" :
[
{
"k" : "1",
"value" : "100"
},
{
"k" : "2",
"value" : "10"
}
]
}
}
}
}
}
{
"ForeExecAtomicResult" :
{
"result" : "A > B: True. Date and time of execution: 08.08.2025 11:18:45"
}
}
public static ForeExecResult ForeExecAtomic(string userToken, string repoId, uint assmKey, string methodName)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tExec = new ForeExecAtomic()
{
tArg = new ForeExecAtomicArg()
{
token = userToken,
metabaseId = repoId,
objKey = assmKey,
foreArg = new ForeExecArg()
{
methodName = methodName,
args = new OdArg[2]
{
new OdArg(){ k = 1, value = "100" },
new OdArg(){ k = 2, value = "10" }
}
}
}
};
// Execute method
var result = somClient.ForeExecAtomic(tExec);
return result;
}
See also: