Jahia en Français > [Jahia 6.6] Problème...

0 (0 Good)
0 (0 Bad)

[Jahia 6.6] Problème de création de rule

by  lubac »  2015/07/22 09:06

Bonjour,

 

Je débute en Jahia et je veux créer une rule qui, à chaque création d'un certain type de noeud, crée un dossier en dessous.

 

Voici ma rule (pour les "import" et les "global", c'est copié/collé à partir d'exemple trouvé) :

###############################################################################
package org.jahia.modules.XXXXXXXX.rules

#list any import classes here.
import org.jahia.services.content.rules.*
import org.jahia.services.content.*
import javax.jcr.observation.Event
import org.slf4j.Logger

#declare any global variables here
global User user
global Service service
global ImageService imageService
global ExtractionService extractionService
global Logger logger
global JCRStoreProvider provider
global AddedNodeFact addedNodeFact
###############################################################################

rule "Create folder for each concertation creation"
   when
        A new node is created
            - the node has the type dcnt:concertation
   then
        Create a new folder node.getName() under the node
        Log "create folder for node " + node.getName()
end

Quand je déploie, voici l'erreur que j'ai :

2015-07-22 11:02:34,134: ERROR [RulesListener] - ---------------------------------------------------------------------------------
2015-07-22 11:02:34,134: ERROR [RulesListener] - Errors when compiling rules in /home/XXXXX/Projets/XXXXX/tomcat/webapps/ROOT/modules/XXXXXXX-components/META-INF/rules.drl : Rule Compilation error : [Rule name=Create folder for each concertation creation, agendaGroup=MAIN, salience=0, no-loop=false]
    org/jahia/modules/XXXXXX/rules/Rule_Create_folder_for_each_concertation_creation_0.java (7:31) : File org/jahia/modules/XXXXXXX/rules/Rule_Create_folder_for_each_concertation_creation_0.java, Line 7, Column 31: Operator ";" expected

2015-07-22 11:02:34,134: ERROR [RulesListener] - ---------------------------------------------------------------------------------
2015-07-22 11:02:34,154: ERROR [RulesListener] - ---------------------------------------------------------------------------------
2015-07-22 11:02:34,154: ERROR [RulesListener] - Errors when compiling rules in /home/lubac/Projets/XXXXX/tomcat/webapps/ROOT/modules/XXXXXXX-components/META-INF/rules.drl : Rule Compilation error : [Rule name=Create folder for each concertation creation, agendaGroup=MAIN, salience=0, no-loop=false]
    org/jahia/modules/XXXXXX/rules/Rule_Create_folder_for_each_concertation_creation_0.java (7:31) : File org/jahia/modules/XXXXXX/rules/Rule_Create_folder_for_each_concertation_creation_0.java, Line 7, Column 31: Operator ";" expected

2015-07-22 11:02:34,154: ERROR [RulesListener] - ---------------------------------------------------------------------------------

 

Je ne comprends pas ce que je fais mal.

Quand je commente le "Create folder...", tout se passe bien.

 

Pouvez-vous m'aider s'il vous plait? Niveau tuto des rules, je ne trouve pas grand chose.

  (lubac)

Number of messages  1
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page