Class PojoTaskWrapper

  • All Implemented Interfaces:
    jadex.bpmn.model.task.ITask

    public class PojoTaskWrapper
    extends java.lang.Object
    implements jadex.bpmn.model.task.ITask
    Task that acts as wrapper for pojo tasks. Allows for using pojo tasks in the same way as conventional ITasks.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.reflect.Method cancelmethod
      The cancel method.
      protected java.lang.Object pojotask
      The pojo task.
      protected java.util.Map<java.lang.String,​FieldInfo> resinjections
      The resinjections.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IFuture<java.lang.Void> cancel​(IInternalAccess process)
      Cleanup in case the task is cancelled.
      IFuture<java.lang.Void> execute​(jadex.bpmn.model.task.ITaskContext context, IInternalAccess process)
      Execute the task.
      java.lang.reflect.Method getCancelMethod()
      Get the cancelmethod.
      java.lang.Object getPojoTask()
      Get the pojotask.
      java.util.Map<java.lang.String,​FieldInfo> getResultInjections()
      Get the resinjections.
      java.lang.Object[] guessParameters​(java.lang.Class<?>[] ptypes, java.util.Set<java.lang.Object> vals)
      Method that tries to guess the parameters for the method call.
      void setCancelMethod​(java.lang.reflect.Method cancelmethod)
      Set the cancelmethod.
      void setPojoTask​(java.lang.Object pojotask)
      Set the pojotask.
      void setResultInjections​(java.util.Map<java.lang.String,​FieldInfo> resinjections)
      Set the resinjections.
      protected void setResults​(boolean noret, java.lang.Object result, jadex.bpmn.model.task.ITaskContext context, IInternalAccess process)
      Set the results.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pojotask

        protected java.lang.Object pojotask
        The pojo task.
      • cancelmethod

        protected java.lang.reflect.Method cancelmethod
        The cancel method.
      • resinjections

        protected java.util.Map<java.lang.String,​FieldInfo> resinjections
        The resinjections.
    • Constructor Detail

      • PojoTaskWrapper

        public PojoTaskWrapper()
        Bean constructor.
      • PojoTaskWrapper

        public PojoTaskWrapper​(java.lang.Object pojotask,
                               IInternalAccess ia,
                               ProcessThread thread,
                               java.util.List<FieldInfo> cominjections,
                               java.util.Map<java.lang.String,​java.util.List<FieldInfo>> arginjections,
                               java.util.Map<java.lang.String,​FieldInfo> resinjections)
        Create a new wrapper task.
    • Method Detail

      • execute

        public IFuture<java.lang.Void> execute​(jadex.bpmn.model.task.ITaskContext context,
                                               IInternalAccess process)
        Execute the task.
        Specified by:
        execute in interface jadex.bpmn.model.task.ITask
        Parameters:
        context - The accessible values.
        process - The process instance executing the task.
        Returns:
        To be notified, when the task has completed.
      • cancel

        public IFuture<java.lang.Void> cancel​(IInternalAccess process)
        Cleanup in case the task is cancelled.
        Specified by:
        cancel in interface jadex.bpmn.model.task.ITask
        Returns:
        A future to indicate when cancellation has completed.
      • guessParameters

        public java.lang.Object[] guessParameters​(java.lang.Class<?>[] ptypes,
                                                  java.util.Set<java.lang.Object> vals)
        Method that tries to guess the parameters for the method call.
      • setResults

        protected void setResults​(boolean noret,
                                  java.lang.Object result,
                                  jadex.bpmn.model.task.ITaskContext context,
                                  IInternalAccess process)
        Set the results.
      • getPojoTask

        public java.lang.Object getPojoTask()
        Get the pojotask.
        Returns:
        The pojotask.
      • setPojoTask

        public void setPojoTask​(java.lang.Object pojotask)
        Set the pojotask.
        Parameters:
        pojotask - The pojotask to set.
      • getCancelMethod

        public java.lang.reflect.Method getCancelMethod()
        Get the cancelmethod.
        Returns:
        The cancelmethod.
      • setCancelMethod

        public void setCancelMethod​(java.lang.reflect.Method cancelmethod)
        Set the cancelmethod.
        Parameters:
        cancelmethod - The cancelmethod to set.
      • getResultInjections

        public java.util.Map<java.lang.String,​FieldInfo> getResultInjections()
        Get the resinjections.
        Returns:
        The resinjections.
      • setResultInjections

        public void setResultInjections​(java.util.Map<java.lang.String,​FieldInfo> resinjections)
        Set the resinjections.
        Parameters:
        resinjections - The resinjections to set.