[ https://issues.apache.org/jira/browse/BROOKLYN-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15270491#comment-15270491 ]
John McCabe commented on BROOKLYN-261: -------------------------------------- Some pertinent additional comments: [~svet]: {{PlanInterpreterGuessingType}} will try to parse the yaml itself to validate it but it only works for top-level catalog item references and it's doing it because the standard camp code path doesn't see the already parsed items because they are still not in the catalog [~alex.heneveld]: so the right fix is to make sure we use some sort of temporary extra catalog with the new versions? [~svet]: yes, the parser should use some kind of overlay catalog passed from the caller, not the global one [~alex.heneveld]: the old behaviour skipped that deeper validation i guess? (so alternatively we could restore that...) [~svet]: You can work around it by adding a top level BasicApplication entity (which is what happens behind the scenes any way). But agree we need to address the underlying problem. > Unable to use previous catalog item in the same file if nested inside services > ------------------------------------------------------------------------------ > > Key: BROOKLYN-261 > URL: https://issues.apache.org/jira/browse/BROOKLYN-261 > Project: Brooklyn > Issue Type: Bug > Affects Versions: 0.10.0, 0.9.1 > Reporter: John McCabe > Priority: Minor > > Attempting to add a catalog with multiple items where an item defined in the > catalog is used by a later item nested inside {{services:}} currently fails: > bq. Could not resolve item 'built-from-test-entity'; 2 errors including: > Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this > plan: Unable to match plan item: > Service[name=<null>,description=<null>,serviceType=test-entity,characteristics=[],customAttributes={}] > {code:title=Not Working|xml} > brooklyn.catalog: > version: 0.0.1 > items: > - id: test-entity > name: Test Entity > item: > services: > - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess > - id: built-from-test-entity > name: Built From Test Entity > item: > services: > - type: test-entity > {code} > *Note* that {{test-entity}} above must not already exist in the catalog or > else the bom above would load. > Altering the {{built-from-test-entity}} to not use nested services allows the > catalog bom to be added: > {code} > - id: built-from-test-entity > name: Built From Test Entity > item: > type: test-entity > {code} > But this does not help for cases where the nesting is necessary, for example: > {code} > - id: built-from-test-entity > name: Built From Test Entity > item: > services: > - type: test-entity > - type: another-entity > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)