Creating a Custom Class

Below is the example of creating a new custom class. The request contains moniker of opened custom class container instance and the pattern indicating whether it is necessary to create a new class. The response contains the updated list of existing custom classes.

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">
<SetCustomExtender xmlns="http://www.fsight.ru/PP.SOM.Som">
<tCustomExtender xmlns="">
  <id>JFHDCPAHAHHCGOAEINHJAHNJDKAOLMFEPJOPHAHKLDFBMCCP!M!S!EEMPBGPAHAHHCGOAEDPGADAFLDKKBEEAEKKOADCJKHIMOAOGI</id>
  </tCustomExtender>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <parsOwnDefVals>true</parsOwnDefVals>
  <classes>Add</classes>
  </pattern>
<meta>
<classes>
<its>
<it>
  <k>-1</k>
<operations>
  <its />
  </operations>
  </it>
  </its>
  </classes>
  </meta>
<metaGet>
  <obInst>true</obInst>
  <parsOwnDefVals>true</parsOwnDefVals>
  <all>true</all>
  </metaGet>
  </tArg>
  </SetCustomExtender>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetCustomExtenderResult 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">
<id xmlns="">
  <id>JFHDCPAHAHHCGOAEINHJAHNJDKAOLMFEPJOPHAHKLDFBMCCP!M!S!EEMPBGPAHAHHCGOAEDPGADAFLDKKBEEAEKKOADCJKHIMOAOGI</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="13" hf="0">
  <i>OBJ52</i>
  <n>System class additions</n>
  <k>52</k>
  <c>5889</c>
  <p>0</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>1</dirty>
<classes>
<its>
<it ic="1">
  <k>19</k>
  <id>COMPONENT</id>
  <n>Component</n>
  <vis>1</vis>
  <implURL />
  <c>1251073</c>
  <h>0</h>
  <implAssembly>MOD_COMPONENT_CLASS_HANDLER</implAssembly>
  <implClass>ComponentClassHandler</implClass>
  <description />
  </it>
<it ic="1">
  <k>16</k>
  <id>BUSINESS_APPLICATION</id>
  <n>Business application</n>
  <vis>1</vis>
  <implURL />
  <c>1054465</c>
  <h>0</h>
  <implAssembly>P10002_BUSINESS_APPLICATION_MOD</implAssembly>
  <implClass>BusinessApplication</implClass>
  <description>Designer of business application</description>
  </it>
<it ic="1">
  <k>32</k>
  <id>DATA_ENTRY_FORM_CLASS</id>
  <n>Data entry/output form</n>
  <vis>1</vis>
  <implURL>http://localhost/FP_App_v10.x/script/operation.js</implURL>
  <c>2103041</c>
  <h>0</h>
  <implAssembly>ASM_INPUT_FORM_V3_PRESENTERS</implAssembly>
  <implClass>CustomClassOperationsHandler</implClass>
  <description />
  </it>
<it ic="0">
  <k>33</k>
  <id>OBJ417</id>
  <n>CustomClass</n>
  <vis>1</vis>
  <implURL />
  <c>2168577</c>
  <h>0</h>
  <implClass />
  <description />
  </it>
  </its>
  </classes>
  </meta>
  </SetCustomExtenderResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetCustomExtender" :
{
"tCustomExtender" :
{
"id" : "JFHDCPAHAHHCGOAEINHJAHNJDKAOLMFEPJOPHAHKLDFBMCCP!M!S!EEMPBGPAHAHHCGOAEDPGADAFLDKKBEEAEKKOADCJKHIMOAOGI"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"classes" : "Add"
},
"meta" :
{
"classes" :
{
"its" :
{
"it" :
[
{
"k" : "-1",
"operations" :
{
"its" : ""
}
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"all" : "true"
}
}
}
}

JSON response:

{
"SetCustomExtenderResult" :
{
"id" :
{
"id" : "JFHDCPAHAHHCGOAEINHJAHNJDKAOLMFEPJOPHAHKLDFBMCCP!M!S!EEMPBGPAHAHHCGOAEDPGADAFLDKKBEEAEKKOADCJKHIMOAOGI"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "13",
"@hf" : "0",
"i" : "OBJ52",
"n" : "System class additions",
"k" : "52",
"c" : "5889",
"p" : "0",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "1",
"classes" :
{
"its" :
{
"it" :
[
{
"@ic" : "1",
"k" : "19",
"id" : "COMPONENT",
"n" : "Component",
"vis" : "1",
"implURL" : "",
"c" : "1251073",
"h" : "0",
"implAssembly" : "MOD_COMPONENT_CLASS_HANDLER",
"implClass" : "ComponentClassHandler",
"description" : ""
},
{
"@ic" : "1",
"k" : "16",
"id" : "BUSINESS_APPLICATION",
"n" : "Business application",
"vis" : "1",
"implURL" : "",
"c" : "1054465",
"h" : "0",
"implAssembly" : "P10002_BUSINESS_APPLICATION_MOD",
"implClass" : "BusinessApplication",
"description" : "Designer of business application"
},
{
"@ic" : "1",
"k" : "32",
"id" : "DATA_ENTRY_FORM_CLASS",
"n" : "Data entry\/output form",
"vis" : "1",
"implURL" : "http:\/\/localhost\/FP_App_v10.x\/script\/operation.js",
"c" : "2103041",
"h" : "0",
"implAssembly" : "ASM_INPUT_FORM_V3_PRESENTERS",
"implClass" : "CustomClassOperationsHandler",
"description" : ""
},
{
"@ic" : "0",
"k" : "33",
"id" : "OBJ417",
"n" : "CustomClass",
"vis" : "1",
"implURL" : "",
"c" : "2168577",
"h" : "0",
"implClass" : "",
"description" : ""
}
]
}
}
}
}
}
public static SetCustomExtenderResult NewClassInCustomExtender(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetCustomExtender()
{
tArg = new SetCustomExtenderArg()
{
pattern = new CustomExtenderMdPattern()
{
classes = ListOperation.Add
},
meta = new CustomExtenderMd()
{
classes = new CustomClasses()
{
its = new CustomClass[]
{
new CustomClass()
{
k = uint.MaxValue,
operations = new CustomOperations()
{
its = new CustomOperation[] { }
}
}
}
}
},
metaGet = new CustomExtenderMdPattern()
{
all = true
}
},
tCustomExtender = new CustomObId() { id = moniker }
};
// Create a custom class
var tResult = somClient.SetCustomExtender(tSet);
return tResult;
}

See also:

SetCustomExtender: Operation