Failed to resolve aspect

cancel
Showing results for 
Search instead for 
Did you mean: 
rguinot
Customer

Re: Failed to resolve aspect

Peux tu poster la définition de ton workflow également ?
st
Member II

Re: Failed to resolve aspect

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
Customer

Re: Failed to resolve aspect

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.