AnttiMustonen
Level 5

Business Adapter Studio - matching with ComplianceComputerID instead of ComputerName

Jump to solution

Hi,

I'm trying to import data using ComplianceComputerID in BAS, using custom property as there is no compliancecomputerID field  available out of the box. But this fails with errors messages on the test run:

The multi-part identifier "compliancecomputer.ComplianceComputerTypeID" could not be bound.
The multi-part identifier "compliancecomputer.compliancecomputerid" could not be bound

Is it possible to match Computer records in BAS with ComplianceComputerID?

I'm not looking to do the matching outside BAS, so running queries aganst FNMP DB is not an option in this case unfortunately.

0 Kudos
2 Solutions
AamerSharif
Flexera
Flexera

No, due to good reason, Compliance computer ID is generated ID, trying to match on ID can lead to corrupt data. That’s one of the reasons to use computer hardware properties to match.
Hope this will help!
Aamer

View solution in original post

As noted, the Business Adapter Studio does not directly expose the primary identity property of object types (for example, the "ComplianceComputerID" property on "Computer" objects) for matching.

However if you are comfortable with editing the XML definitions of adapters directly using a text editor, you can do this by adding a <Property Type="compliancecomputerid" .../> reference to use for matching existing records like the following:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <ManageSoft connectiontype="default" runintransaction="False" />
  <Imports>
    <Import Type="SqlServer" Name="Import1" ConnectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SourceDB;Data Source=sql01.acme.corp" Query="SELECT ComplianceComputerID, HostedIn FROM YourSource">
      <Object Type="Computer" Name="Computer" Update="True" Create="False" OutputField="Computer_ID">
        <Property Type="compliancecomputerid" Name="Compliance Computer ID" ValueType="Field Value" Value="ComplianceComputerID" UseForMatching="True" />
        <Property Type="serviceprovider" Name="Hosted In" Update="Do not blank" ValueType="Field Value" Value="HostedIn" Length="250" />
      </Object>
    </Import>
  </Imports>
</root>

One point to note when doing this is that your adapter should only update records, not attempt to create new records: note the <Object ... Create="False" ...> in the XML definition.

From memory, I believe that you can then still open adapter XML files in the Business Adapter Studio to continue to work on them there once the XML has had a reference to an identity property added like this.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

View solution in original post

8 Replies
AamerSharif
Flexera
Flexera

No, due to good reason, Compliance computer ID is generated ID, trying to match on ID can lead to corrupt data. That’s one of the reasons to use computer hardware properties to match.
Hope this will help!
Aamer

View solution in original post

erwinlindemann
Level 8

Hi Antti,

Typically, in BAS, you can do a mapping of the computer name to the internal ComplianceComputerID value.

As an example, say you want to populate allocations for a software license. In this case, in BAS you would first populate an object of type [Computer] before populating a [License] and [Software Allocation] object.

In the [Computer] object, you should map the [Computer Name] field to the column containing the name of your computer and set the checkbox "Use this property for matching existing data". Of course, you can configure additional fields like [Serial Number] as matching criteria, too.

In BAS, an additional field called [Computer_ID] will be populated that actually contains the [ComplianceComputerID] value. YOu can use this field for populating the [Computer ID] value in additional target objects like [Software Allocation].

I hope the picture below helps with explaining this.

erwinlindemann_0-1584623902450.png

 

Hi @erwinlindemann and @AamerSharif ,

Thanks for your swift responses.

Unfortunately I was probably not very clear in my opening post.

I have source data that has only ComplianceComputerID and some values to update ComplianceComputer target table, for example "Hosted In".  So the target is also "Computer" item in BAS. For items like "Software License Allocation" ComputerID exists so the matching can be made, but this does not apply to in this case.

 

 

0 Kudos

@AnttiMustonen - You will need to have your source data changed to include Computer Name/Serial Number or some other field for matching to the Computer object in the Business Adapter.

If you have FNMS On-Premises, then you could put raw SQL into your Business Adapter to do the update, but I would advise against that.

Thanks @kclausen 

We try to avoid using SLQ staging tables etc. so we will likely look into using matching with multiple other specs (serial numbers, etc) than complianceComputer, which would have been more convenient in this case though - but as stated also by @AamerSharif could cause corruption.

0 Kudos

As noted, the Business Adapter Studio does not directly expose the primary identity property of object types (for example, the "ComplianceComputerID" property on "Computer" objects) for matching.

However if you are comfortable with editing the XML definitions of adapters directly using a text editor, you can do this by adding a <Property Type="compliancecomputerid" .../> reference to use for matching existing records like the following:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <ManageSoft connectiontype="default" runintransaction="False" />
  <Imports>
    <Import Type="SqlServer" Name="Import1" ConnectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SourceDB;Data Source=sql01.acme.corp" Query="SELECT ComplianceComputerID, HostedIn FROM YourSource">
      <Object Type="Computer" Name="Computer" Update="True" Create="False" OutputField="Computer_ID">
        <Property Type="compliancecomputerid" Name="Compliance Computer ID" ValueType="Field Value" Value="ComplianceComputerID" UseForMatching="True" />
        <Property Type="serviceprovider" Name="Hosted In" Update="Do not blank" ValueType="Field Value" Value="HostedIn" Length="250" />
      </Object>
    </Import>
  </Imports>
</root>

One point to note when doing this is that your adapter should only update records, not attempt to create new records: note the <Object ... Create="False" ...> in the XML definition.

From memory, I believe that you can then still open adapter XML files in the Business Adapter Studio to continue to work on them there once the XML has had a reference to an identity property added like this.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

View solution in original post

Thanks, @ChrisG  this was an excellent proposal!

I got it working when running BAS import from command line.

Running from BAS shows following exclamations and crashed on me once (migh be random occurence).

In any case the use of ComplianceComputerID is proven plausible thanks to you (although officially unsupported method)

AnttiMustonen_0-1585563686554.png

AnttiMustonen_1-1585563890933.png

BR, Antti

 

 

Hi,

I created an idea to expose all object IDs in BAS, please feel free to vote: https://flexerasfdc.ideas.aha.io/ideas/FNMS-I-161

Best regards,

Markward

Softline Group is Europe's leading independent expert in Software Asset Management.