SetAssembly

Syntax

SetAssemblyResult SetAssembly(OdId tObject, SetAssemblyArg tArg)

Parameters

tObject. Assembly moniker.

tArg. Operation execution parameters.

Description

The SetAssembly operation is used to set up assembly and start algorithms implemented in the assembly.

Comments

To execute the operation, in the tObject parameter specify moniker of repository object that is assembly. The object moniker can be obtained on executing the GetObjects operation. In the tArg.meta parameter specify assembly metadata that should be applied. The operation changes the list of links to other assemblies. Changes are saved on executing the operation. The tArg.run parameter enables the user to start entry point that should be implemented in the assembly.

The operation results in the list of messages that can be displayed by the executed code in the console, including compiler messages.

Example

Below is the example of using the SetAssembly operation to start assembly for execution. The request contains moniker of assembly in the repository. The response contains text of messages displayed in the console on execution. 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">
<SetAssembly xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>S1!M!172000</id>
  </tObject>
<tArg xmlns="">
  <run>true</run>
  </tArg>
  </SetAssembly>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetAssemblyResult 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">
  <consoleOutput xmlns="">Hello World!!! Current date: August 11 2020. Current time: 11:42:12. Current repository: Warehouse </consoleOutput>
  </SetAssemblyResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetAssembly" :
{
"tObject" :
{
"id" : "S1!M!172000"
},
"tArg" :
{
"run" : "true"
}
}
}

JSON response:

{
"SetAssemblyResult" :
{
"consoleOutput" : "Hello World!!! Current date: August 11 2020 Current time: 11:42:12. Current repository: Warehouse "
}
}
public static SetAssemblyResult RunAssembly(MbId mb, string assmId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetAssembly()
{
tArg = new SetAssemblyArg()
{
run = true
},
//Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, assmId).k }
};
//Start assembly
var result = somClient.SetAssembly(tSet);
return result;
}

See also:

Working with Development Environment