ForeExecWithState

Syntax

ForeExecResult ForeExecWithState(ForeId tFore, ForeExecArg tArg, ForeExecStateArg tStateArg)

Parameters

tFore. Moniker.

tArg. Operation execution parameters.

tStateArg. Parameters for saving objects on state server.

Description

The ForeExecWithState operation executes methods implemented in Fore units with subsequent saving of objects on state server.

Comments

The state server should be first installed and configured to work with BI server.

To execute the operation, in the tFore field specify moniker of the unit, assembly that contains implementation of the executed method. The moniker can be obtained on executing the GetObjects operation. In the tArg.methodName field specify name of the method to be executed, and in the tArg.args field specify values of the method input parameters. In the tArg.tStateArg field specify parameters for saving objects on state server.

The operation should meet all requirements, features and recommendations that the ForeExec operation has.

Example

Below is the example of executing the method with sending repository objects as parameter values. The request contains name of the executed method and moniker of the development environment object containing method implementation. Parameter values contain repository connection monikers and moniker of opened instance of express report. After executing the method, the express report state will be saved on the state server. The executed method has the following syntax:

Method

The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ForeExecWithState xmlns="http://www.fsight.ru/PP.SOM.Som">
<tFore xmlns="">
  <id>CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M!7360</id>
  </tFore>
<tArg xmlns="">
  <methodName>WorkWithObject</methodName>
<args>
<it>
  <k>1</k>
  <value>CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M</value>
  </it>
<it>
  <k>2</k>
  <value>CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M!S!ENPDFCNCMALALFOAEBIAIIOLLHIEDGGIEAKNLNKCFNJJDEKLP</value>
  </it>
  </args>
  </tArg>
<tStateArg xmlns="">
  <saveState>true</saveState>
<objectsToSave>
  <s>CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M!S!ENPDFCNCMALALFOAEBIAIIOLLHIEDGGIEAKNLNKCFNJJDEKLP</s>
  </objectsToSave>
  </tStateArg>
  </ForeExecWithState>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ForeExecWithStateResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <result xmlns="" />
  </ForeExecWithStateResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"ForeExecWithState" :
{
"tFore" :
{
"id" : "CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M!7360"
},
"tArg" :
{
"methodName" : "WorkWithObject",
"args" :
{
"it" :
[
{
"k" : "1",
"value" : "CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M"
},
{
"k" : "2",
"value" : "CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M!S!ENPDFCNCMALALFOAEBIAIIOLLHIEDGGIEAKNLNKCFNJJDEKLP"
}
]
}
},
"tStateArg" :
{
"saveState" : "true",
"objectsToSave" :
{
"s" : "CJHOLKCMALALFOAEKGINPHCCMHHOLIHEBJLCOLDNKEKMKCKG!M!S!ENPDFCNCMALALFOAEBIAIIOLLHIEDGGIEAKNLNKCFNJJDEKLP"
}
}
}
}

JSON response:

{
"ForeExecWithStateResult" :
{
"result" : ""
}
}
public static ForeExecResult ExecMethodWithState(MbId mb, string assmId, string methodName, string objMoniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tExec = new ForeExecWithState()
{
tArg = new ForeExecArg()
{
methodName = methodName,
//Monikers as parameters values
args = new OdArg[2]
{
new OdArg(){ k = 1, value = mb.id },
new OdArg(){ k = 2, value = objMoniker }
}
},
//Moniker of development environment object with method implementation
tFore = new ForeId()
{
id = mb.id + "!" + FindObjectById(mb, assmId).k
},
tStateArg = new ForeExecStateArg()
{
saveState = true,
objectsToSave = new string[] { objMoniker }
}
};
//Execute method and save object state
var result = somClient.ForeExecWithState(tExec);
return result;
}

See also:

Specific Operations