Get JCR Session in workflow in  CQ 5.5

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

The execute method has WorkflowSession.  So wsession.getSession() should give you JCR session. More api details at
http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/workflow/WorkflowSession.html

Similar Messages

  • How to get jcr Session in the workflow?

    Hi,
    I'm using CQ 5.6 and I would like to know how we can get jcr seession in the workflow?
    API: com.adobe.granite.workflow.WorkflowSession;
      It doesn't have getSession() method as we have in com.day.cq.workflow.WorkflowSession.
    Any pointers would be helpful..
    Thanks
    Siva

    Adapt the workflowSession object to a JCR session.
    Session session = workflowSession.adaptTo(Session.class);

  • Session in workflow

    Hi!
    I know with ":display.session" in workflows doesn't work. But with <invoke class='getLighthouseContext'><ref>WS_CONTEXT</ref></invoke> only I can get an InternalSession, but I need the "LocalSession", How can I get this in a workflow?
    Thanks.

    try with this
    <Rule name='getAdminSession'>
    <invoke name='getSession' class='com.waveset.session.SessionFactory'>
    <invoke name='getSubject'>
    <new class='com.waveset.server.InternalSession'/>
    <s>#ID#Configurator</s>
    </invoke>
    <s>Admin</s>
    <s>Administrator Interface</s>
    </invoke>
    </Rule>

  • I am trying to buy songs on itunes and half way through the terms and conditions come up, I accept them and press return and then I get a 'session timed out' notice and the sale hasn't gone through - tried loads of times / updating software, any answers?

    I am trying to buy songs on itunes and half way through the terms and conditions come up, I accept them and press return and then I get a 'session timed out' notice and the sale hasn't gone through - tried loads of times / updating software, any answers?

    I am trying to buy songs on itunes and half way through the terms and conditions come up, I accept them and press return and then I get a 'session timed out' notice and the sale hasn't gone through - tried loads of times / updating software, any answers?

  • Hi, I cant login to the facebook app on my iphone 5 ios 6.0.2.  I keep getting an error message saying 'There was an error logging in using single sign on' when im asked to log in again i get a 'session expired' message.  This only started happening yeste

    Hi, I cant login to the facebook app on my iphone 5 ios 6.0.2.  I keep getting an error message saying 'There was an error logging in using single sign on' when im asked to log in again i get a 'session expired' message.  This only started happening yesterday. Anyone else having this problem? Thanks.

    I am having the same problem and took the following steps to mitigate it to no avail.
    1. I deleted the Facebook app on the phone and turned off Facebook in the iPhone's system-wide settings.
    2. I re-enabled Facebook in the iPhone's system-wide settings and reinstalled the Facebook app and logged in again. It worked. For about an hour.
    3. I completely restored the phone to a previous backup (before the problems started) and reenabled Facebook .... reinstalled the app.... and now it works intermittenly. But it hasn't worked in about 12 hours now (just tried a few minutes ago).
    Please advise.

  • I try to redeem an iTunes GC and I get a "Session Has Timed Out" Message. The same thing happens when I try to download a song, after I'm taken to the SLA page

    I try to redeem an iTunes GC and I get a "Session Has Timed Out" Message. The same thing happens when I try to download a song, after I'm taken to the SLA page. I sent Apple Support an email. They told me its software on my computer restricting access to my Internet Connection, but I haven't installed any new software since my last purchase from the iTunes Store. What can I do to fix this?!?! Thanks

    Delete and redownload them if doing so is free in your country.
    (106637)

  • How to get HTTP session in Applcation Module IMPL file

    Hi Guys,
    Can any one tell me how to get HTTP session in Applcation Module IMPL file ?
    thnks

    You can, but that's not a best practice.
    Re: How to reach HttpContext from model Project

  • How to get second session in second browser

    I have got an B2B application that has 3 types of users - [System]Admin , Vendor & Clients.
    In one of the use cases an 'Admin' user can launch a new window [browser] on behalf of client or a vendor and do whatever he wants . All the while, his ie. admin user's ID is maintained in the first browser.
    The issue I am facing is when I open a new/second browser [on clicking of a link] on behalf of vendor /client, my admin user ID is getting replaced with Vendors/Client in the first browser as well. Mean to say, I am able to open a new browser, work on behalf of a client /vendor but when going bak to the first browser[admin's] user ID and other admin user related information is not available and are found to be replaced by the vendor/client information
    FYI: User ID is fetched/maintained from Session.
    Can anybody tell me how to create a seperate session for the second browser so that I can parallely work on behalf of my ownself[as a Admin user] and also on behalf of a Vendor/Client user on two different browsers.
    Message was edited by:
    Venkyt

    Should i use target "new" instead "invoice"?Doesn't matter. Managing the sessions as I said it is the safest way IMO. From the first request, get the session ID, add it to a hidden input field and then go by that, instead of asking for a session ID that maybe has changed.
    Or use a cookie, or simply continue working in the same window.

  • How to get transacted session in direct mode with jmsra adapter

    Hi,
    I use MQ 4.4u1 release with GF in EMBEDDED mode. I configured several connection factories with NoTransaction/LocalTransaction/XATransaction support. In my app I get a connection factory from JNDI tree, create connection/session/producer and send several messages to queue. Everything works fine when I don't use transactions. But, when I want to send messages in one transaction, the connection always provided to me non-transacted session. The session created via
    Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
    request. I check the session transacted state and acknowledge mode right after i get it:
    log.fine("Session: " + session + "; transacted: " + session.getTransacted() + "; ackMode: " + session.getAcknowledgeMode());
    The log shows me that the session is not transacted and ackMode is 0 (DUPS_OK_ACKNOWLEDGE). If I try to commit the session after messages were sent I get the correct exception:
    javax.jms.IllegalStateException: MQJMSRA_DS4001: commit():Illegal for a non-transacted Session:sessionId=3361979872663370240
    Does anyone know how to get transactional session in direct mode?
    Thanks, Denis.

    I mentioned LOCAL because I misread your post and thought you were suggesting that LOCAL mode behaved differently.
    If you want to send messages in a transaction from within a Servlet then I think you're expected to use a UserTransaction: Here's an example that worked for me:
            Connection connection = outboundConnectionFactory.createConnection();
            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
            userTransaction.begin();
            MessageProducer producer = session.createProducer(outboundQueue);
            int numberOfMessages = 10;
            for (int i = 0; i<numberOfMessages; i++) {
                Message message = session.createTextMessage("Hello world");
                producer.send(message);
            userTransaction.commit();
            connection.close();I obtained the UserTransaction with this resource declaration:
        @Resource(name = "java:comp/UserTransaction")
        private UserTransaction userTransaction;The EJB spec explicitly states that local transactions aren't supported in EJBs; I haven't found such an explicit statement for Servlets but suspect that JMSRA is taking the same approach.
    As for imq.jmsra.direct.disableCM property - this appears to disable connection pooling and from your post changes other behaviour as well. How did you find out about it (other than by examining the code)? As far as I can see this is not a documented feature and is not necessarily tested or supported.

  • BT Home Hub Manager - how do I get a session start...

    I'm a patient person but really ... I've been trying to get the d*** thing online so I can make some changes and I've veen waiting now for nearly three hours .... only 100 sessions allowed ... I had no idea I wouldn't be able to access my own router settings whenever I wanted when I signed up ... HELP!!!!
    What must I do to get a session started?
    Solved!
    Go to Solution.

    HELP!
    I need to get this sorted .... I don't know who to contact at BT ... there doesn't seem to be anyway to phone anyone for any answers ................... Please can somebody give me some directions .... I actually have some work I'd like to get done .... and my new faster broadband ... while much faster ... isn't allowing me to access my Home Hub to set up my system according to MY needs.   Where else can I go for help????????
    If nobody monitors or reads these posts ..... what's the point?   I may as well just hit my head of my wall as waste MORE of my time doing this!
    PLEASE .... all I want is some answers and a point in the right direction ... maybe a phone number so I could talk to somebody technical would be helpful ..... I can't sit here ALL DAY waiting for some selfish b****** to close their idle session.

  • How to get the session name of a batch input

    hi everybody
    does anybody know how to get the session name of a batch input?
    I have to put the name of the session at the end of my program so that the user can click on the session name to go directly to SM35 to run the batch input when the program ends

    Hi sia,
    1. Table is APQI
    2. field name for session name is GROUPID
    regards,
    amit m.

  • [svn:bz-trunk] 21394: bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX .

    Revision: 21394
    Revision: 21394
    Author:   [email protected]
    Date:     2011-06-16 12:34:13 -0700 (Thu, 16 Jun 2011)
    Log Message:
    bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX.
    get the sessions id before we invalidate the duplicate session.
    Checkintests pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseHTTPEndpoint.java

    For our profect I think this issue was caused as follows:
    Believing that remoting was full asynchronous we fired a 2 or 3 remote calls to the server at the same time ( within the same function ) - usually when the users goes to a new section of the app.
    This seemed to trigger the duplicate http session error since according to http://blogs.adobe.com/lin/2011/05/duplication-session-error.html  two remote calls arriving before a session is created will cause 2 sessions to be created.
    Our current solution ( too early to say it works ) is to daisy chain the multiple calls together .
    Also there seemed to be an issue where mobile apps that never quit ( thanks Apple! )  caused the error when activated after a few hours.
    I guess the session expires on the server and the error above occurs on activation.
    So the mobile apps now ping the server with a remote call when activated after sleeping for more than one hour.
    All duplicate http errors are silently caught and reported.
    Fingers crossed we won't get any more!

  • Get user sessions in ABAP

    Hi,
    my problem is to get active sessions of a specific user
    (as I can see from SM04, selecting a row and clicking "Session")
    The program behind SM04 is RSM04000_ALV;
    the
    call 'ThUsrInfo' id 'OPCODE' field opcode_list
    id 'TABUSR' field usr_tabl-sys
    get the info about the logged users (first screen of SM04).
    Then, the details are shown in dynpro 2000 that contains a
    module syst-okopo that does not exixts, and it's impossible to see in debug what happens!!!
    Please Help
    Thanks a lot
    A.try to use this
    CALL FUNCTION 'TH_LONG_USR_INFO'
        EXPORTING
          user      = sy-uname
        TABLES
          user_info = usr_tabl.

    Hi,
    try to use this
    CALL FUNCTION 'TH_LONG_USR_INFO'
        EXPORTING
          user      = sy-uname
        TABLES
          user_info = usr_tabl.
    Reward if helpfull...
    Cheers,
    Sundar.

  • Get the session trace files and also the TKPROF reports for storedprocedure

    Hi ,
    I am trying to find out the bottlenecks on a storedprocedure, which does a insert into a table, where the target table has lot of indexes/constraints, so i want to see, which indexes/constraints is causing the problem. so in order to do I want to get the session trace files and also the TKPROF reports to see the bottlenecks for a oracle stored procedure,
    Could you please give us the list of steps to get the tracefiles and tkprof reports.

    781649 wrote:
    Thanks for input, i am using oracle10g standard edition. i dont think i have these tools available (DBMS_PROFILER or DBMS_HPROF). Did you even bother to try the following?
    SQL> DESC DBMS_PROFILER
    SQL> DESC DBMS_HPROF
    I understand it would be too much to expect you to actually Read The Fine Manual
    I am using bulk collect for all in my storedprocedure to insert the rows into a big table. In order to perform analysis on this bulk collect which tool will help me to identify the bottlenecks .
    I want to compare background session properties for both runs (like inserting the data with indexes/constraints vs without indexes/constraints). please let me know..I am willing to bet you the problem/slowness is on the SELECT side & not the INSERT!
    Just Curious
    Handle:      781649
    Status Level:      Newbie
    Registered:      Jul 12, 2010
    Total Posts:      35
    Total Questions:      17 (14 unresolved)
    Why so many unanswered questions?
    Edited by: sb92075 on Jan 17, 2012 3:13 PM

  • AuthD failed to get auth session

    I have a new installation of portal, but something is not working properly (probably our changes to authentication service schemas and organization-level changes).
    The message ("AuthD failed to get auth session") shows up in the amAuth log:
    ERROR: AuthD init()
    com.iplanet.dpro.session.SessionException: AuthD failed to get auth session
    at com.sun.identity.authentication.service.AuthD.initAuthSessions(AuthD.java:617)
    at com.sun.identity.authentication.service.AuthD.<init>(AuthD.java:203)
    at com.sun.identity.authentication.service.AuthD.getAuth(AuthD.java:368)
    at com.sun.identity.authentication.service.AuthUtils.<init>(AuthUtils.java:101)
    at com.sun.identity.authentication.UI.AuthViewBeanBase.<init>(AuthViewBeanBase.java:67)
    at com.sun.identity.authentication.UI.AuthExceptionViewBean.<init>(AuthExceptionViewBean.java:61)

    There are many reasons to get this error, following may be one of them
    Scenario 1: Your directory server is not running
    Scenario 2: The naming service not initialized because it could not find the server entry in the platform list, especially if you are running SSL enabled server makes sure you have added the correcsoponding platfrom entry with correct protocol. IF you have forgot to add , you can add it from Directory adminconsole
    Scenario 3: In a multiserver installation sharing the same DS, you need to make sure you supply the correct encryption key of the server 1 while installing the second server. To quickly check both are matching check the serverconfig.xml of both servers should be identical
    Scenario 4: You have installed the Identity against existing provisoned DIT and selected NO for question 'You want to load IS comapliant DIT' during isntallation. In this case you need to go through the postinstallation steps before accessing the adminconsole

Maybe you are looking for

  • Error in Configure JMSAdmin utililty

    Hi, I have installed IBM MQ Series 5.3 on windows XP. I am attempting to use JMSAdmin to configure my qcf and queues that my applications will talk to. When I run JMSAdmin and try to create my qcf I get unable to bind object. InitCtx> define QCF(samp

  • Document sent as an attachment

    hi i m using function module SO_NEW_DOCUMENT_ATT_SEND_API1 for sending an attachment here i m able to send a one attachment can i sent more than one attachment and How to do how many doc i have to attached that is not known Pls help me on this Points

  • How to convert a large number to hex without truncating to 32-bit.

     I am trying to convert a very large number to hexadecimal (string). The number gets truncated to 32-bit, which is not what I want. For example, the number 28037546508295 (double) should be 0x198000000007. Labview truncates it and the resulting strin

  • Difference between struts and jsf

    hi which one you have to prefer and why? Please helpon this Thanks, Vijay

  • JPEG file options

    How does saving a file as alow (vs high) format JPEG reduce the file size? I saved both as a test, opened in photoshop and looked at image size: the resolution and pixel dimensions are the same while the file size differs.