[jboss-user] [jBPM] - Re: understanding taskclient

Diduch Cordova do-not-reply at jboss.com
Tue Feb 22 15:04:11 EST 2011


Diduch Cordova [http://community.jboss.org/people/diduch] created the discussion

"Re: understanding taskclient"

To view the discussion, visit: http://community.jboss.org/message/589086#589086

--------------------------------------------------------------
I AM WORKING WITH THIS... IN THE PROPERTIES OF THE EMAIL SERVICE TASK, I FILLED TO,SUBJECT,FROM AND BODY... WHEN I RUNNING DE PROCESS IN DEBUG.. THE PROCESS COMES TO THE EMAIL TASK BUT DONT SEND THE EMAIL AND DONT PASS TO NEXT USER TASK.... 

public static final void main(String[] args) {
        try {
            // load up the knowledge base
            KnowledgeBase kbase = readKnowledgeBase();
            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
            KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);
            ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());
            // start a new process instance            
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("employee", "krisv");
            EmailWorkItemHandler handler = new EmailWorkItemHandler("smtp.gmail.com", "465", " mailto:user at gmail.com user at gmail.com","password");
            ksession.getWorkItemManager().registerWorkItemHandler("Email", handler);
            ksession.startProcess("com.sample.evaluation", params);    
            logger.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

    private static KnowledgeBase readKnowledgeBase() throws Exception {
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);        
        return kbuilder.newKnowledgeBase();
    }
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/589086#589086]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

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


More information about the jboss-user mailing list