[jboss-user] [jBPM] - Re: Create Custom Implementation for Human Task WorkItemHandler, Which class I should extend?

Timothy Charman do-not-reply at jboss.com
Mon Dec 3 05:33:38 EST 2012

Timothy Charman [https://community.jboss.org/people/tcharman] created the discussion

"Re: Create Custom Implementation for Human Task WorkItemHandler, Which class I should extend?"

To view the discussion, visit: https://community.jboss.org/message/779582#779582

No, just the session manager.  There's a hook for contributing your own, see how the session manager instantiates a MVELSingleSessionManager if you don't give it one below.

We give it our own so we can add them programmatically rather than using the config file.  Our session manager does what the MVEL one does but doesn't use a template, it adds the task handlers in code.

    public static SessionManager newSessionManager(KnowledgeBase kbase) {
        String sessionManager = System.getProperty("jbpm.session.manager");
        if (sessionManager == null) {
            return new MVELSingleSessionManager(kbase);

        SessionManager sessionManagerInstance = null;
        try {
            // build session manager based on given class
            Class<SessionManager> sessionManagerClass = (Class<SessionManager>) Class.forName(sessionManager);
            Constructor<SessionManager> c = sessionManagerClass.getConstructor(KnowledgeBase.class);
            sessionManagerInstance = c.newInstance(kbase);
        } catch (Exception e) {
            throw new RuntimeException("Cannot create SessionManager from class " + sessionManager, e);

        return sessionManagerInstance;

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121203/88b649ac/attachment.html 

More information about the jboss-user mailing list