If you use inheritance of assets in fabric composer and want to implement a transaction that execution is dependent on the actual asset type, you can use the following convention. Supposing that you have inheriting assets, like:
asset Ancestor identified by assetId {
o String assetId
}
asset Descendant extends Ancestor{
}
you can query the exact type and the namespace of the asset with the following code:
toState.$type
toState.$namespace