4 Replies Latest reply on Feb 11, 2015 5:17 PM by stevenhu

    Custom WorkItemHandler gets null ksession

    stevenhu

      I have a process with 4 custom work items (Highlighted in red box), shown in the following:

      process.png

      When I started and executed the process, I found the custom workitem [GetProfile] and [GetPomProfile] got a correct ksession instance, but other two [ExecuteCommand] and [ValidateTxn] got a NULL kession. (AbstractWorkItemHandler is the parent class of all custom work item handlers). Can anyone tell me why the following custom work item handler is getting null kession input?

       

      the kie deployment descriptor on work item handlers:

      <work-item-handler>
        <resolver>mvel</resolver>
        <identifier>new com.pti.fsc.wfe.workitem.handler.FscQueryProfileParameterWorkItemHandler(ksession)</identifier>
        <parameters />
        <name>GetProfile</name>
      </work-item-handler>
      <work-item-handler>
        <resolver>mvel</resolver>
        <identifier>new com.pti.fsc.wfe.workitem.handler.FscQueryProfileParameterWorkItemHandler(ksession)</identifier>
        <parameters />
        <name>GetPomProfile</name>
      </work-item-handler>
      <work-item-handler>
        <resolver>mvel</resolver>
        <identifier>new com.pti.fsc.wfe.workitem.handler.FscExecuteWorkItemHandler(ksession)</identifier>
        <parameters />
        <name>ExecuteCommand</name>
      </work-item-handler>
      <work-item-handler>
        <resolver>mvel</resolver>
        <identifier>new com.pti.fsc.wfe.workitem.handler.FscValidateTxnWorkItemHandler(ksession)</identifier>
        <parameters />
        <name>ValidateTxn</name>
      </work-item-handler>
      


      the log is pasted here:

      org.jbpm.services.task.wih.ExternalTaskEventListener - >> I've recieved an event for a known session (135)

      com.pti.fsc.wfe.workitem.handler.FscQueryProfileParameterWorkItemHandler - Execute workitem handler receives passed parameters >>>>>> ...(serviceCode=WFEDEMO), (siteCode=MDBANK), (companyCode=shu020201), (counterPartyCode=SELLER01), (parameterCategory=testQuery), (parameterName=poAutoFlag), (operationServiceCode=), (workItemId=75), deploymentId:com.pti.fsc:wfedemo:1.0.0), processInstanceId:44), (parameters={partyType=SELLER, serviceCode=WFEDEMO, siteCode=MDBANK, parameterName=poAutoFlag, parameterSubCategory=subCategory, counterPartyCode=SELLER01, parameterCategory=testQuery, companyCode=shu020201})

      com.pti.fsc.wfe.workitem.handler.AbstractWorkItemHandler - ------ KieSession>>>org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession@5d9fcc1d

      com.pti.fsc.wfe.workitem.handler.AbstractWorkItemHandler - ------ ProcessInstance>>>WorkflowProcessInstance44 [processId=fsc.wfe.underScoreSequential,state=1]

       

      com.pti.fsc.wfe.workitem.handler.FscValidateTxnWorkItemHandler - *********passed parameters >>>>>> (serviceCode:WFEDEMO), (siteCode:MDBANK), (companyCode:shu020201), (itemType:EJBCALL), (itemKey:shu020201), (validationType:testValidate), (validationParameters:), (parameters:{serviceCode=WFEDEMO, validationType=testValidate, siteCode=MDBANK, companyCode=shu020201, itemKey=shu020201, itemType=EJBCALL}), (workItemId:76), (deploymentId:com.pti.fsc:wfedemo:1.0.0), (processInstanceId:44)

      com.pti.fsc.wfe.workitem.handler.AbstractWorkItemHandler - ------ KieSession>>>null