Forum Discussion

Amitosh_Tripathy's avatar
6 years ago

Load xClass and xProperties, and link xProperties to multiple xClasses from AML

We want to load 1k+ xclasses to Aras, we are talking about 4k+ xproperties here.

 

When we are running AML for creating relations xClass_xProperty_Flatten and xClass_xPropertyDefinition to link them to class tree, it fails with error :

<faultstring><![CDATA["xClass_xProperty_Flatten" can be added or deleted or updated only in XTree context]]></faultstring>

<detail>

        <af:legacy_detail><![CDATA["xClass_xProperty_Flatten" can be added or deleted or updated only in XTree context]]></af:legacy_detail>

        <af:exception message="&quot;xClass_xProperty_Flatten&quot; can be added or deleted or updated only in XTree context" type="System.ArgumentException" />

      </detail>

 

I can load property definitions, but not classes, but can’t map the properties to classes. How can we mass create and reuse these xProperty definitions in more than one class from AML, by creating relations correctly?

2 Replies

  • My project evolved to this exact problem of creating the 'xClass_xPropertyDefinition' and 'xClass_xProperty_Flatten'. Itemtypes. However, I was able to figure out how to call 'in xTree Context' 

    <AML>
      <Item type='xClassificationTree' id="DFCA73A38AB9457F94EB6CA43CE617C7" action='edit'>
          <Relationships>
            <Item type='xClass_xPropertyDefinition' action="add">
              <source_id>C90E6B9D8A3045EAA21954F1B2FAD9C9</source_id>
              <related_id>6A0B41B77836433783A537A01FEA4BF8</related_id>
            </Item>
          </Relationships>
      </Item>
    </AML>

    The remaining problem is a permissions issue. I have added 'Can add' and 'update' permissions to the xClassificationTree, xClass, xPropertyDefinition, xClass_xPropertyDefinition, but this is the response I'm getting: 

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
        <SOAP-ENV:Fault xmlns:af="http://www.aras.com/InnovatorFault">
          <faultcode>SOAP-ENV:Server.InsufficientPermissionsException</faultcode>
          <faultstring><![CDATA[You have insufficient permissions to perform 'add' operation.]]></faultstring>
          <detail>
            <af:legacy_detail><![CDATA[You have insufficient permissions to perform 'add' operation.]]></af:legacy_detail>
            <af:exception message="You have insufficient permissions to perform 'add' operation." type="Aras.Server.Core.InsufficientPermissionsException" />
            <af:permission type="can_add" itemtype="xClass_xPropertyDefinition" />
          </detail>
        </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    If anyone has any ideas how to get around this, it would be greatly appreciated, I've been stuck on it for almost 2 weeks now... 

  • I have a very similar issue, trying to create the xClass nodes under the xClassification Tree. I matched the <source_id> from a manually created one, but it still tells me  ["xClass" can be added or deleted or updated only in XTree context].