AnsweredAssumed Answered

Behaviour not works

Question asked by v.scorsone on Apr 16, 2018
Latest reply on Apr 23, 2018 by jpotts

Hi, i've createad this model:

<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="" name="dm:Demo">
        <import uri="" prefix="cm"/>
        <import uri="" prefix="d"/>
        <namespace uri="" prefix="dm"/>
        <type name="dm:demoTemplate">
            <title>Demo Template</title>
                <property name="dm:placeholder1">
                    <title>Placeholder 1</title>
                    <index enabled="true">

with the Model Manager of Alfresco 5.2.f.

I must implement a behaviour on update properties of demoTemplate.

In my init method i have:

QName MODEL_TEMPLATE_QNAME = QName.createQName("http//", "demoTemplate");


public void init() {
this.onUpdateProperties = new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindClassBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME, MODEL_TEMPLATE_QNAME, this.onUpdateProperties);


 when i add my amp to alfresco.war and restart the server, there is the error:

Caused by: java.lang.IllegalArgumentException: Class {http//}demoTemplate has not been defined in the data dictionary

how can i resolve this issue? i've read some post about this but i cant resolve. I have another question, there is a more "dynamic" way to do this without add the model.xml to my amp?