1 Reply Latest reply on Sep 4, 2012 11:20 AM by Sham HC

    Get JCR Session in workflow in  CQ 5.5

    ravindrareddydr Level 1

      HI

       

      I am trying to get javax.jcr.Session in my workflow
      ......................................................................................... ...............
      public class GroupCreatorWorkflow implements WorkflowProcess{

              private static final Logger log =
      LoggerFactory.getLogger(GroupCreatorWorkflow.class);

              private ResourceResolverFactory resourceResolverFactory;

              public void execute(WorkItem item, WorkflowSession wsession,
      MetaDataMap metadata)
                               throws WorkflowException {

      try{

              ResourceResolver resolver;
           resolver =
      resourceResolverFactory.getAdministrativeResourceResolver(null);
           Session session = resolver.adaptTo(javax.jcr.Session.class);

      }catch (Exception e) {

          log.info("Exceptions @@@@@@@");

               log.info(e.getMessage());

       

      }
      }

      ........................

      Log :

       

      /content/demo/default] com.demo.wcm.GroupCreatorWorkflow Exceptions
      @@@@@@@
      /content/demo/default] com.demo.wcm.GroupCreatorWorkflow null

      Please let me know, if i am following wrong to get JCRSession.

      Thanks

      DR Reddy