@After
  public void tearDown() throws Exception {
    Double duration = ((System.currentTimeMillis() - time) / 1000.0);
    System.out.println("Time: " + duration + "s");

    try {
      FenixFramework.getTransactionManager().rollback();
    } catch (IllegalStateException | SecurityException | SystemException e) {
      e.printStackTrace();
    }
  }
  @Override
  protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {

    long startTime = System.currentTimeMillis();

    logger.info("DEBUT Web Script SynchroniseDroitsSHDWebScript");

    Map<String, Object> model = new HashMap<String, Object>();
    model.put("nomWebScript", "SynchroniseDroitsSHDWebScript");

    if (!isSiteSirhExist()) {
      logger.debug("Site SIRH not exist");

      long endTime = System.currentTimeMillis();

      model.put("nbrAgentCree", "Site SIRH not exist");
      model.put("tempsExecution", endTime - startTime);

      return model;
    }

    NodeRef nodeAgents =
        alfrescoUtilsService.getNodeRef(
            "/app:company_home/site:sites/cm:SIRH/cm:documentLibrary/cm:Agents");

    List<ChildAssociationRef> listChildren = nodeService.getChildAssocs(nodeAgents);

    int nbrAgentCree = 0;
    if (null != listChildren && 0 < listChildren.size()) {
      for (ChildAssociationRef child : listChildren) {
        // nous gerons nous meme les transactions
        // car nous avons eu "TransactionalCache' is full"
        // cela ralentit fortement Alfresco
        UserTransaction trx =
            serviceRegistry.getTransactionService().getNonPropagatingUserTransaction(false);
        try {
          trx.begin();

          String nameFolderAgent =
              (String) nodeService.getProperty(child.getChildRef(), ContentModel.PROP_NAME);
          Integer idAgent = null;
          try {
            idAgent =
                new Integer(
                    nameFolderAgent.substring(
                        nameFolderAgent.length() - 7, nameFolderAgent.length()));
          } catch (NumberFormatException e) {
            logger.error("Error ParseException Node : " + nameFolderAgent);
            idAgent = null;
          }

          if (null != idAgent) {
            logger.debug("Add SHD Rights to " + idAgent);
            traiteDroitsOfNodeAgent(child, idAgent, nameFolderAgent);
            nbrAgentCree++;
          }

          trx.commit();
        } catch (Throwable e) {
          try {
            trx.rollback();
          } catch (IllegalStateException | SecurityException | SystemException e1) {
            logger.error(e1.getMessage());
          }
        }
      }
    }

    long endTime = System.currentTimeMillis();

    logger.info("FIN Web Script SynchroniseDroitsSHDWebScript");

    model.put("tempsExecution", endTime - startTime);
    model.put("nombreAgentsAjoutesSHD", nbrAgentCree);

    return model;
  }