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.
Mar 19, 2020 07:57 AM
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
Mar 19, 2020 08:18 AM - edited Mar 19, 2020 08:29 PM
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.
Mar 30, 2020 02:24 AM
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
Mar 19, 2020 08:18 AM - edited Mar 19, 2020 08:29 PM
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.
Mar 19, 2020 08:18 AM
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.
Mar 20, 2020 03:14 AM
@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.
Mar 20, 2020 06:43 AM
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.
Mar 20, 2020 07:52 AM
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.
Mar 30, 2020 02:24 AM
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)
BR, Antti
Mar 30, 2020 05:27 AM
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
May 28, 2021 02:44 AM