1 Reply Latest reply on Sep 8, 2011 4:32 AM by Antonio De Berardis

    Problem terminating a process

    Antonio De Berardis Newbie

      Hi,

      I have a process with some Human Tasks and some Java Service Task.

      For the Human Tasks I registered the WorkItemHandler like this:

       

      CommandBasedWSHumanTaskHandler wsh2= new CommandBasedWSHumanTaskHandler(ksession);

      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", wsh2); 

       

      while for my Service Task, I have implemented my handler:

       

      public class JavaWorkItemHandler implements WorkItemHandler {

       

       

                @Override

                public void executeWorkItem(WorkItem workItem, WorkItemManager arg1) {

           //do something

          

           Map<String, Object> result=new HashMap<String, Object>();

           arg1.completeWorkItem(workItem.getId(), result);

       

           }

      @Override

                public void abortWorkItem(WorkItem arg0, WorkItemManager arg1) {

       

            arg1.abortWorkItem(arg0.getId());

                }

      }

      and registered it:

       

                                    ksession.getWorkItemManager().registerWorkItemHandler("JavaNode", new JavaWorkItemHandler()); 

       

      the process looks like this:

       

      processus.png

       

       

      If I'm in the first Human Task and I send from outside an Event to terminate the process, I have:

       

      org.jbpm.task.service.PermissionDeniedException: User '[User:'Administrator']' was unable to execution operation 'Skip' on task id 1 due to no 'current status' matchines

      at org.jbpm.task.service.TaskServiceSession.evalCommand(TaskServiceSession.java:232)

                at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:344)

                at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:84)

                at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

                at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)

                at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

                at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:176)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)

                at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)

                at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)

                at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)

                at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)

                at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)

                at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:679)

       

       

      then the process will continue with the execution of the java task and the second Human Task.

      Can anybody help me?

      Thank you.

      Antonio

        • 1. Re: Problem terminating a process
          Antonio De Berardis Newbie

          Hi again,

          I have some more informations about my problem:

          the process is started as a reusable sub-process by another process; if the parent process send the event, I got the error.

          The event is sent in a script task with this code:

               kcontext.getKnowledgeRuntime().signalEvent("abort",null,subProcId);

           

          I tried to change the process to send the signal event by the process itself and not by the parent

          processus.png

          and everything works fine.

           

          Where I'm wrong?

           

          Antonio