====Extending the Example to Cover Multiple Assets====
If you've followed the [[agent_walkthrough_-_design|example so far]], you might have felt that it's a very complex process for such a simple alert.
And you'd be right.
The complexity starts to become worth the trouble once you start using different [[attachment|attachment]] options.
In the example so far, we've created an AI that works on the **Main Pump** asset. But we've got quite a few pumps across our site, and we'd like to create AIs for all of them.
To do this, we adjust the settings for attachment and [[binding|binding]].
===Attachment===
Our different pumps each have a shared ARDI //type//, in this case called **Pump**.
We can attach our agent to //every// pump in our ARDI database by using the //type// attachment.
"attachment": [ {
"style": "type",
"asset": "Pump"
}]
===Binding===
But at the moment, our bindings all refer to the Main Pump specifically. We need to resolve that.
Bindings have a special [[relative binding format|relative binding format]]. By replacing the name of your asset with '{0}', you'll substitute the name of each asset you're attaching to.
For example, if you had the following water pumps....
|Pump A|
|Pump B|
|Emergency Water Pump|
...the relative binding '{0}.Load' attached to every pump in your system would be translated into 'Pump A.Load', 'Pump B.Load' and 'Emergency Water Pump.Load' as it found your pumps.
"binding": {
"Load": "{0}.Load"
},
===Results===
With these changes, we've built a single AI with a common set of rules, then deployed it to //every pump in the system//.
Even better, if any new pumps are created in the future, they'll //automatically get a monitoring AI// without any human intervention. Likewise, pumps that are removed will have their AIs automatically removed.
===Property Binding===
What if we wanted to take this further? There's a lot of equipment out there with motors, and not all of them are pumps. What if we could extend the AI to those, too?
A //property// binding creates an AI on every asset that has a matching set of properties.
"attachment": [ {
"style": "property",
"asset": "Load"
}]
The attachment above will connect this AI to every asset that has the 'Load' property, ensuring that you have monitoring for any other motors you have (such as conveyors, stirrers, vibrators etc.).
===Others===
Now that you've seen an example of a simple AI, you might want to see some [[Agent Examples|more complex examples]].