cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to resolve aspect

st
Champ in-the-making
Champ in-the-making
Bonjour à tous,

Je viens solliciter votre aide de nouveau car j'ai un problème que je n'arrive pas à régler. Il s'agit d'une cohabitation d'un aspect et d'un workflow dans mon alfresco. L'un sans l'autre marche mais les deux en meme temps me provoquent un erreur…

Alors voilà je vous dit tout :
j'ai un créé un aspect dans exampleModel.xml (se trouve dans C:\alfresco-community-2.1.0\tomcat\shared\classes\alfresco\extension) : "my : docA"

Voilà le contenu de mon fichier :

<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>

<!– The important part here is the name - Note: the use of the my: namespace
     which is defined further on in the document –>
<model name="my:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Example custom Model</description>
   <author></author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>  
   <imports>
        <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="my.new.model" prefix="my"/>
   </namespaces>
  

      <constraints>
   <constraint name="my:AStatusC" type="LIST">
         <parameter name="allowedValues">
            <list>
                  <value>Delivered by A</value>
              <value>Qualified by S</value>
         </list>
         </parameter>
      </constraint>
   </constraints>
  
  
   <types>
  
      <!– Definition of new Content Type: Standard Operating Procedure –>
     <!–
      <type name="my:sop">
         <title>Standard Operating Procedure</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:publishedDate">
               <type>d:datetime</type>
            </property>
            <property name="my:authorisedBy">
               <type>d:text</type>
            </property>
         </properties>
         <associations>
            <association name="my:signOff">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
            <child-association name="my:processSteps">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:content</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
         </child-association>           
         </associations>
      </type>
      –>
    </types>
   
    <aspects>
      <aspect name="my:docA">
         <title>Document A</title>
         <properties>
            <property name="my:ADocumentVersion">
               <type>d:text</type>
            </property>
            <property name="my:AApplicationVersions">
               <type>d:text</type>
            <multiple>true</multiple>
            </property>
            <property name="my:AApplicationCode">
               <type>d:text</type>
            </property>
            <property name="my:AStatus">
               <type>d:text</type>
            <default>Delivered by A</default>
            <constraints>
                  <constraint ref="my:AStatusC"/>
               </constraints>
            </property>
         </properties>
      </aspect>
   </aspects>

</model>


Ensuite j'ai un fichier qui s'appelle example-model-context.xml (qui se trouve dans : C:\alfresco-community-2.1.0\tomcat\shared\classes\alfresco\extension)

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!– Registration of new models –>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/exampleModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>

et finalement j'ai un code dans web-client-config-custom (qui se trouve dans : C:\alfresco-community-2.1.0\tomcat\shared\classes\alfresco\extension et dans C:\alfresco-community-2.1.0\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension (je ne sais pas ou exactement le mettre…donc je l'ai mis dans les deux…) )


<alfresco-config>

   <!– Example of overriding the from email address –>
   <!–
   <config>
      <client>
         <from-email-address>someone@your-domain.com</from-email-address>
         <search-max-results>100</search-max-results>
      </client>
   </config>
   –>

   <!– Example of adding languages to the list in the login page –>
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES">Catalan</language>
         <language locale="hr_HR">Croatian</language>
         <language locale="cs_CZ">Czech</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pl_PL">Polish</language>
         <language locale="pt_PT">Portuguese</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="sv_SV">Swedish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </config>

   <!– Example of configuring advanced search –>
   <!–
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

   <!– Example of changing the sort direction for a view in the client –>
   <!–
   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>
   –>

   <!– Example of adding a custom icon to the Create Space dialog –>
   <!–
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>
   –>

   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>
   <!–
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:publishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="my:processSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
   –>


<config evaluator="aspect-name" condition="my:docA">
      <property-sheet>
         <show-property name="my:AStatus"/>
         <show-property name="my:AApplicationCode"/>
         <show-property name="my:AApplicationVersions"/>
         <show-property name="my:ADocumentVersion"/>
      </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:docA"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <custom-properties>
            <meta-data aspect="my:docA" property="my:AStatus" />
            <meta-data aspect="my:docA" property="my:AApplicationCode" />
            <meta-data aspect="my:docA" property="my:AApplicationVersions" />
            <meta-data aspect="my:docA" property="my:ADocumentVersion" />
         </custom-properties>
      </advanced-search>
   </config>

  
     <!– Definition des interfaces utilisateurs utilisees pour le workflow test –>

<config evaluator="node-type" condition="scwf:submitReviewTask" replace="true">
  <property-sheet>
   <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>–>
   <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator"/>–>
   <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
    <show-association name="bpm:assignee" />
  </property-sheet>
</config>
  
<config evaluator="node-type" condition="scwf:aReviewing" replace="true">
  <property-sheet>
    <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>
    <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
    <show-property name="bpm:comment" component-generator="TextAreaGenerator"/>
  </property-sheet>
</config>
  
<config evaluator="node-type" condition="scwf:sRevision" replace="true">
  <property-sheet>
    <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>
    <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
    <show-property name="bpm:comment" component-generator="TextAreaGenerator"/>
    <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
    <show-association name="bpm:assignee" display-label-id="wf_reviewer"/>
  </property-sheet>
</config>


</alfresco-config>


Vous remarquerez que le code à la fin du précédent fichier provient d'un workflow que j'ai mis en place.

Voilà. alfresco boote correctement.
Evidemment j'ai testé beaucoup de choses et j'ai remis la base de données à zéro à chaque fois pour être sur que ça ne vienne pas de là.

Mon problème est que pris indépendamment, j'ai bien mon aspect "Document A" qui s'affiche dans Alfresco lorsque je veux ajouter un aspect. Donc pas de soucis.
quand je pends mon workflow tout seul, il marche aussi.
Mais lorsque je lance un Alfresco ou j'ai les deux ensemble (rappelons que le seul fichier commun est web-client-config-custom.xml) et bien là mon workflow marche bien, mais j'ai pas l'aspect qui apparait..

Etrange non? :shock:

Cela fait trois jours entiers que je teste toutes les combinaisons possibles de fichiers que je reprends des alfresco "neuf" en y rajoutant petit à petit les fihciers et que je n'arrive toujours pas à avoir cet aspect qui s'affiche et qui marche sans que cela ne me provoque l'erreur :

WARN  [org.alfresco.web.bean.actions.BaseActionWizard] Failed to resolve aspect 'my:docA'

Je m'en remets donc à ceux qui expérimentés ou intéressés, voudront bien m'aider à solutionner ce problème qui est en train de me gacher mes journées …

Merci d'avance!

Saralix
12 REPLIES 12

rguinot
Confirmed Champ
Confirmed Champ
Peux tu poster la définition de ton workflow également ?

st
Champ in-the-making
Champ in-the-making
ok! La voici :

<?xml version="1.0" encoding="utf-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="scwf:test">
 
  <!–Definition des swimlanes–>

  <swimlane name="initiator">
  </swimlane>

  <swimlane name="assignee">
   <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{bpm_assignee}</actor>
      </assignment>
  </swimlane>
   
  <!–Definition du processus–>

<start-state name="start">
     <task name="scwf:submitReviewTask" swimlane="initiator"/>
   <transition name="submit" to="Submit">
      <action class="org.alfresco.repo.workflow.jbpm.AlfJavaScript">
                <script>
                  
         <!–Find the Acceptance folder–>
         var acceptanceFolder = companyhome.childByNamePath("Acceptance");
         
         <!–If it doesn't exist, create it for the first time–>
         if (acceptanceFolder == null){
            acceptanceFolder = companyhome.createFolder("Acceptance");
         }

         if (acceptanceFolder != null){
            var bpmpackage = bpm_package;
            <!–get the file from where the workflow was started = the file one wants to move–>
            var doc = bpmpackage.children[0];
            doc.addAspect("cm:versionable");
            doc.save();
            doc.move(acceptanceFolder);
            acceptanceFolder.setPermission("Delete");
            <!– create mail action–>
            var mail = actions.create("mail");
            mail.parameters.to = initiator.properties["cm:email"];;
            mail.parameters.subject = "Hello from JavaScript";
            mail.parameters.from = bpm_assignee.properties["cm:email"];
            mail.parameters.template = companyhome.childByNamePath("space/notify_user_email.ftl");
            mail.parameters.text = "some text, in case template is not found";
            <!–execute action against a document–>
            mail.execute(doc);   
            
         }
         
         
               </script>
           </action>
      </transition>   
  </start-state>
 
  <node name="Submit">
   <transition name="accepted" to="A Review"/>
  </node>
  
  <task-node name="A Review">
    <task name="scwf:aReview" swimlane="assignee"/>
   <transition name="approve" to="end1">
      <action class="org.alfresco.repo.workflow.jbpm.AlfJavaScript">
      <runas>admin</runas>
         <script>
         <!–Find the Acceptance folder–>
         var validatedFolder = companyhome.childByNamePath("Validated");
         

         <!–If it doesn't exist, create it for the first time–>
         if (validatedFolder == null){
            validatedFolder= companyhome.createFolder("Validated");
         }

         if (validatedFolder != null){
            validatedFolder.setPermission("CreateChildren");
            var bpmpackage = bpm_package;
            <!–get the file from where the workflow was started = the file one wants to move–>
            var doc = bpmpackage.children[0];
            doc.move(validatedFolder);
         }
               </script>
       </action>
      </transition>   
   <transition name="reject" to="S Revision">
      <action class="org.alfresco.repo.workflow.jbpm.AlfJavaScript">
      <runas>admin</runas>
          <script>
         <!–Find the Acceptance folder–>
         var workingFolder = companyhome.childByNamePath("Working");
         
         <!–If it doesn't exist, create it for the first time–>
         if (workingFolder == null){
            workingFolder = companyhome.createFolder("Working");
         }

         if (workingFolder != null){
            var bpmpackage = bpm_package;
            <!–get the file from where the workflow was started = the file one wants to move–>
            var doc = bpmpackage.children[0];
            doc.move(workingFolder);
         }
               </script>
           </action>
      </transition>   
  </task-node>
     
<task-node name="S Revision">
    <task name="scwf:sRevision" swimlane="assignee"/>
   <transition name="Re-Submit" to="A Review">
      <action class="org.alfresco.repo.workflow.jbpm.AlfJavaScript">
                <script>
         <!–Find the Acceptance folder–>
         var acceptanceFolder = companyhome.childByNamePath("Acceptance");
         
         <!–If it doesn't exist, create it for the first time–>
         if (acceptanceFolder == null){
            acceptanceFolder = companyhome.createFolder("Acceptance");
         }
         
         

         if (acceptanceFolder != null){
            var bpmpackage = bpm_package;
            <!–get the file from where the workflow was started = the file one wants to move–>
            var doc = bpmpackage.children[0];
            doc.move(acceptanceFolder);
         }
               </script>
           </action>
      </transition>   
  </task-node>
  <end-state name="end1"/>

</process-definition>

Je sais que "org.alfresco.repo.workflow.jbpm.AlfJavaScript" risque de t'interpeler : il s'agit d'un 'patch' que je suis en train d'essayer de faire fonctionner. L'erreur ne peut pas venir de là! Je viens juste de faire ça ce matin, alors que ça ne marchait pas non plus hier avec la classe alfrescojavaScript…
D'ailleurs j'ai une question à poser sur ce sujet. Si tu connais la réponse… :wink:
Merci rguiniot!

rguinot
Confirmed Champ
Confirmed Champ
Euh juste pour info c rguinot pas rguiniot Smiley Happy

Malheuresement je ne suis pas expert sur les workflows ayant très peu pratiqué.
Si j'ai d'autres idées qui me viennent je les posterais.