CMDBuild Forum

Basic Connector without worklow and how to configure domains

Hi,

 

Is it possible to use the basic connector without workflow? How?

How should I configure the domains in the connector to work?

I have defined the following configuration in transform.xsl 

 

<xsl:template match="/inventory/system"> 

<PC_OA key="SYSTEM_ID" identifiers="SYSTEM_ID"> 

<SYSTEM_ID> 

<xsl:value-of select="./SYSTEM_ID" /> 

</SYSTEM_ID> 

<fqdn> 

<xsl:value-of select="./fqdn" /> 

</fqdn> 

<hostname> 

<xsl:value-of select="./hostname" /> 

</hostname> 

<os_name> 

<xsl:value-of select="./os_name" /> 

</os_name> 

<model> 

<xsl:value-of select="./model" /> 

</model> 

<manufactur> 

<xsl:value-of select="./manufactur" /> 

</manufactur> 

</PC_OA> 

</xsl:template> 

<xsl:template match="/CMDBUILD/PC_OA"> 

<PC_OA key="SYSTEM_ID"  identifiers="SYSTEM_ID"> 

<xsl:attribute name="objid"> 

        <xsl:value-of select="./@objid" /> 

      </xsl:attribute> 

<SYSTEM_ID> 

<xsl:value-of select="./SYSTEM_ID" /> 

</SYSTEM_ID> 

<fqdn> 

<xsl:value-of select="./fqdn" /> 

</fqdn> 

<os_name> 

<xsl:value-of select="./os_name" /> 

</os_name> 

<model> 

<xsl:value-of select="./model" /> 

</model> 

<manufactur> 

<xsl:value-of select="./manufactur" /> 

</manufactur> 

</PC_OA> 

</xsl:template> 

<xsl:template match="/inventory/sys_sw_software"> 

<PC_Software_OA domain="OA_PC_SoftwareInstalled" domaindirection="directed" identifiers="software_id"> 

<software_id> 

<xsl:value-of select="./software_id" /> 

</software_id> 

<software_name> 

<xsl:value-of select="./software_name" /> 

</software_name> 

<software_version> 

<xsl:value-of select="./software_version" /> 

</software_version> 

<software_install_date> 

<xsl:value-of select="./software_install_date" /> 

</software_install_date> 

</PC_Software_OA> 

</xsl:template> 

<xsl:template match="/CMDBUILD/PC_Software_OA">

<PC_Software_OA domain="OA_PC_SoftwareInstalled" domaindirection="directed" identifiers="software_id">

<xsl:attribute name="objid">

<xsl:value-of select="./@objid" />

</xsl:attribute>

<software_id> 

<xsl:value-of select="./software_id" /> 

</software_id> 

<software_name> 

<xsl:value-of select="./software_name" /> 

</software_name> 

<software_version> 

<xsl:value-of select="./software_version" /> 

</software_version> 

<software_install_date> 

<xsl:value-of select="./software_install_date" /> 

</software_install_date> 

</PC_Software_OA>

</xsl:template>

 

 

The cards were created for both class, but not the relations. 

There aren't errors in log files. I saw these traces in cmdbuild.log

 

INFO  2014-07-04 11:27:38 [workflow] synchronizing process state, activities and (maybe) variables

INFO  2014-07-04 11:27:38 [workflow] synchronizing variables

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'Code' with value 'Inserimento Modifiche'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'Description' with value 'Creazione di PC_Software_OA - PC_OA: 1'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'FlowStatus' with value 'null'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'actionList' with value '<?xml version="1.0" encoding="UTF-8"?>


<ExternalSync>

<cardList>

<PC_Software_OA identifiers="software_id" domaindirection="directed" domain="OA_PC_SoftwareInstalled">

<software_id>293</software_id>

<software_name>Microsoft .NET Framework 3.0 Service Pack 2</software_name>

<software_version>3.2.30729</software_version>

<software_install_date>20131017</software_install_date>

</PC_Software_OA>

</cardList>

<cardMaster>

<masterCardId>1524</masterCardId>

<masterClassName>PC_OA</masterClassName>

</cardMaster>

<action>create</action>

</ExternalSync>

'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'actionDetail' with value 'Creato un nuovo elemento: PC_Software_OA

 Descrizione: software_id: 293

software_name: Microsoft .NET Framework 3.0 Service Pack 2

software_version: 3.2.30729

software_install_date: 20131017

'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'ProcessCode' with value '1998_Package_importasset_Process_importasset'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'NextExecutor' with value 'null'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'ActivityInstanceId' with value 'null'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'PrevExecutors' with value 'null'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'UniqueProcessDefinition' with value 'null'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'ActivityDefinitionId' with value 'null'

DEBUG 2014-07-04 11:27:38 [workflow] synchronizing variable 'Notes' with value ''

INFO  2014-07-04 11:27:39 [workflow] process is completed, delete if from workflow service

 

 

 

 

 

 

Thanks.

 

 

No, you can use the Wizard Connector without workflow (see the External Connectors Manual)

CMDBuild Team

Previously Tecnoteca wrote:

No, you can use the Wizard Connector without workflow (see the External Connectors Manual)

CMDBuild Team

 

 
 
OK. And the second question about domains and relations?

Previously Miguel Angel wrote:

Previously Tecnoteca wrote:

No, you can use the Wizard Connector without workflow (see the External Connectors Manual)

CMDBuild Team

 

 
 
OK. And the second question about domains and relations?

Hi

For me i can update by wizard connector from mysql BDD, but i can't update detail classes connected with
domain 1: N 
Is this possible at first to realize through the wizard ?
If Yes How ?
Thanks

Hello,

I had the same problem with import from OCS Inventory, turned out that my view was wrong.  My reference (domain) is called "ServerDisk" which has "Server" as origin and "Disks" as destination and cardinality 1:N. I have the following files/contents:

 

/home/ocs/Dsk_Connector/sql/CMDBUILD_storage.sql:

 

CREATE OR REPLACE VIEW CMDBuild_storage

AS SELECT HARDWARE_ID, ID, TAG, NAME, MANUFACTURER, MODEL, DESCRIPTION, TYPE, DISKSIZE, SERIALNUMBER, FIRMWARE

FROM storages, accountinfo

WHERE storages.HARDWARE_ID=accountinfo.HARDWARE_ID;

 

/home/ocs/Dsk_Connector/conf/cmdbuild-schema.xml:

 

<?xml version="1.0"?>

 

<CMDBUILD>

        <DiskDrives>

                <Code />

                <DiskName />

                <Description />

                <DiskOwner />

                <Manufacturer />

                <Model />

                <Type />

                <FRUNumber />

                <DiskSize />

                <SerialNumber />

                <Firmware />

        </DiskDrives>

        <Servers>

                <Code />

        </Servers>

</CMDBUILD>

 

/home/ocs/Dsk_Connector/conf/transform.xsl:

 

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />

        <xsl:template match="/">

                <CMDBUILD>

                        <xsl:apply-templates />

                </CMDBUILD>

        </xsl:template>

        <xsl:template match="*">

                <xsl:apply-templates />

        </xsl:template>

        <xsl:template match="text()"></xsl:template>

 

        <xsl:template match="/inventory/storage">

                <DiskDrives key="Code">

                        <DiskName>      <xsl:value-of select="./NAME" />                        </DiskName>

                        <Description>   <xsl:value-of select="./DESCRIPTION" />                 </Description>

                        <DiskOwner>     <xsl:value-of select="./TAG" />                         </DiskOwner>

                        <Manufacturer>  <xsl:choose>

                                                <xsl:when test="contains(./MANUFACTURER, 'FRU')" >

                                                        <xsl:value-of select="substring-before(./MANUFACTURER, ',FRU')" />

                                                </xsl:when>

                                                <xsl:otherwise>

                                                        <xsl:value-of select="./MANUFACTURER" />

                                                </xsl:otherwise>

                                        </xsl:choose>                                           </Manufacturer>

                        <Model>         <xsl:choose>

                                                <xsl:when test="starts-with(./MODEL, '/')" >

                                                        <xsl:value-of select="substring(./MODEL, 5)" />

                                                </xsl:when>

                                                <xsl:otherwise>

                                                        <xsl:value-of select="./MODEL" />

                                                </xsl:otherwise>

                                        </xsl:choose>                                           </Model>

                        <Type>          <xsl:value-of select="./TYPE" />                        </Type>

                        <FRUNumber>     <xsl:if test="contains(./MANUFACTURER, 'FRU')" >

                                                <xsl:value-of select="substring-after(./MANUFACTURER, ':')" />

                                        </xsl:if>                                               </FRUNumber>

                        <DiskSize>      <xsl:value-of select="./DISKSIZE" />                    </DiskSize>

                        <SerialNumber>  <xsl:value-of select="./SERIALNUMBER" />                </SerialNumber>

                        <Firmware>      <xsl:value-of select="./FIRMWARE" />                    </Firmware>

                </DiskDrives>

        </xsl:template>

 

        <xsl:template match="/CMDBUILD/DiskDrives">

                <DiskDrives key="Code">

                        <DiskName>      <xsl:value-of select="./DiskName" />                    </DiskName>

                        <Description>   <xsl:value-of select="./Description" />                 </Description>

                        <DiskOwner>     <xsl:value-of select="./DiskOwner" />                   </DiskOwner>

                        <Manufacturer>  <xsl:value-of select="./Manufacturer" />                </Manufacturer>

                        <Model>         <xsl:value-of select="./Model" />                       </Model>

                        <Type>          <xsl:value-of select="./Type" />                        </Type>

                        <FRUNumber>     <xsl:value-of select="./FRUNumber" />                   </FRUNumber>

                        <DiskSize>      <xsl:value-of select="./DiskSize" />                    </DiskSize>

                        <SerialNumber>  <xsl:value-of select="./SerialNumber" />                </SerialNumber>

                        <Firmware>      <xsl:value-of select="./Firmware" />                    </Firmware>

                </DiskDrives>

        </xsl:template>

 

        <xsl:template match="/CMDBUILD/Servers">

                <Servers domain="ServerDisk" domaindirection="directed" identifiers="Code">

                        <xsl:attribute name="objid">

                                <xsl:value-of select="./@objid" />

                        </xsl:attribute>

                        <Code>

                                <xsl:value-of select="./Code" />

                        </Code>

                </Servers>

        </xsl:template>

 

</xsl:stylesheet>

 

Hope this will help you

 

 

 

Previously Bachir Kadiri wrote:
Previously Miguel Angel wrote:
Previously Tecnoteca wrote:

No, you can use the Wizard Connector without workflow (see the External Connectors Manual)

CMDBuild Team

 

 
 
OK. And the second question about domains and relations?

Hi

For me i can update by wizard connector from mysql BDD, but i can't update detail classes connected with
domain 1: N 
Is this possible at first to realize through the wizard ?
If Yes How ?
Thanks