[jbpm-users] how to get kcontext variable of on entry action in my WorkItemHandler

Burkhard Vogel Burkhard.Vogel at modinter.com.ec
Fri Aug 19 10:38:02 EDT 2011


jcc:

WorkItem:

public class InitiateHandler implements WorkItemHandler {

     private StatefulKnowledgeSession ksession;

     public InitiateHandler(StatefulKnowledgeSession ksession) {
         this.ksession = ksession;
     }

     public void executeWorkItem(WorkItem workitem, WorkItemManager
manager) {

         ProcessContext kcontext = new ProcessContext(this.ksession);
         WorkflowProcessInstance processInstance =
(WorkflowProcessInstance)
ksession.getProcessInstance(workitem.getProcessInstanceId());
         kcontext.setProcessInstance(processInstance);
...

in your Process calling code:

         ksession = loadStatefulKnowledgeSession(sessionId);
         ksession.getWorkItemManager().registerWorkItemHandler("Init",
new InitiateHandler (ksession));


Regards,


On 18/08/2011 23:07, jiacc at gillion.com.cn wrote:
> hi,
> how to get kcontext variable of on entry action in my WorkItemHandler.
> regards.
> jcc
> --
> This email was Anti Virus checked by Astaro Security Gateway. MODINTER S.A.

--

Saludos cordiales,

*Burkhard Vogel*
*Lead Strategic Development*


modinter
*Centre of Sales & Support • Quito, Ecuador*

Leonidas Plaza N24-318 y Baquerizo Moreno
Edificio Plaza 246
Phone:   +593 2 2237393 ext 7300

Mobile:   +593 9 5771800
E-mail: burkhard.vogel at modinter.com.ec
<mailto:burkhard.vogel at modinter.com.ec>

*www.modinter.com.ec* <http://www.modinter.com.ec/>

The information in this e-mail and any attachments is confidential and
is intended for the addressee only and may contain confidential,
proprietary or legally privileged information. If you are not the
intended recipient, please delete this message and any attachments and
advise the sender by return e-mail. Unless otherwise stated, any pricing
or deliver information given in this message is indicative only, is
subject to change and to formal communication.
FISA GROUP and each or any of its operating companies reserve the right
to monitor all e-mail communication through its networks.



More information about the jbpm-users mailing list