AnsweredAssumed Answered

Alfresco Share and onCreate policy (customized behaviour)

Question asked by itrub on Jun 23, 2011
Latest reply on Jun 29, 2011 by loftux
Dear colleagues
I have a question about very interesting problem, that, seems, was not discussed before. So, I try to explain it as clear as possible.
I  wrote the new behaviour class, that realizes policy "onCreate" relationaly to documents of type SomeType. It works successfully, when I create SomeType-document in Alfreso Explorer. Action, that I implemented in behaviour class, is performed without errors. But this behaviour does not work when I create SomeType-document in Alfresco Share! I think, the reason is following. In Alfresco Explorer I choose document type before the document has been created, so, when the new Node Reference of type SomeType appears, Alfresco already knows, that the new document is SomeType-document, so onCreate trigger fires.
But in Alfreso Share I firstly create document without type and after that, when NodeReference on cm:content-document (not SomeType!) already exists, I perform action "Change Type" and transform new document to SomeType. So, may be trigger does not fire:
1) when I create document, because the type of this document is not SomeType;
2) when I perform "Change Type", because this is already not the new document, Node Reference has been created earlier.
If this explanation is true, what are possible decisions of this problem?
Sincerely, Iliya