1.2.5.2.2. Esempio 2: Impostazione del percorso di importazione con "DTO"

Un altro esempio di come impostare il percorso di importazione quando i prodotti sono disponibili:

  1. Creare un filtro VBS ( da qualche parte nella pipeline dopo l'esecuzione del convertitore). Mettere VBS ( plugin_template_DTO.vbs ) e VB Classe ( PluginBaseC_DTO ).

    Figura 1.214. 

    Figura 1.215. 

  2. Aggiungere il codice seguente alla funzione DTO un:

     ' Create new classification
      Dim classification As PSolUnitProxy.prxClassification_1
      Set classification = CreateObject("wh.Classification_1")
      classification.SystemId = "customID"
        
      ' Prepare attribute.
      Dim newAttr As PSolUnitProxy.prxProductAttribute_1
      Set newAttr = CreateObject("wh.ProductAttribute_1")
    
      ' Prepare the attribute value.
      Dim newAttrVal As PSolUnitProxy.prxAttributeValue_1
      Set newAttrVal = CreateObject("wh.AttributeValue_1")
      newAttrVal.Text = "newtestpath/whatever“ ‘ Import Path for parts
        
      newAttr.Name = "imppath_"
      newAttr.Group = "imppath"
      Set newAttr.Value = newAttrVal
            
      ' Add Attribute to classification
      classification.addAttributeValue(newAttr)    
      ' Add classification to product
      product.addClassification(classification)

  3. Modificare il nodo struttura in PARTdataCenter.

    Figura 1.216. 

    Percorso del documento: imppath (gruppo di attributi); imppath_ (nome)

    Nella classificazione:
       "SystemId": "customID",
       "AttributeValue": [
           {
               "Name": "imppath_",
               "Group": "imppath",
               "Value": {
                   "Text": "newtestpath2/whatever"
               }
           }
       ]