Class DefaultUserTaskListener

java.lang.Object
dev.dsf.bpe.v1.activity.DefaultUserTaskListener
All Implemented Interfaces:
org.camunda.bpm.engine.delegate.TaskListener, org.springframework.beans.factory.InitializingBean

public class DefaultUserTaskListener extends Object implements org.camunda.bpm.engine.delegate.TaskListener, org.springframework.beans.factory.InitializingBean
Default TaskListener implementation. This listener will be added to user tasks if no other TaskListener is defined for the 'create' event type.

BPMN user tasks need to define the form to be used with type 'Embedded or External Task Forms' and the canonical URL of the a Questionnaire resource as the form key.

To modify the behavior of the listener, for example to set default values in the created 'in-progress' QuestionnaireResponse, extend this class, register it as a prototype Bean and specify the class name as a task listener with event type 'create' in the BPMN.

  • Field Summary

    Fields inherited from interface org.camunda.bpm.engine.delegate.TaskListener

    EVENTNAME_ASSIGNMENT, EVENTNAME_COMPLETE, EVENTNAME_CREATE, EVENTNAME_DELETE, EVENTNAME_TIMEOUT, EVENTNAME_UPDATE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
    afterQuestionnaireResponseCreate(org.camunda.bpm.engine.delegate.DelegateTask userTask, org.hl7.fhir.r4.model.QuestionnaireResponse afterCreate)
    Override this method to execute code after the QuestionnaireResponse resource has been created on the DSF FHIR server
    protected void
    beforeQuestionnaireResponseCreate(org.camunda.bpm.engine.delegate.DelegateTask userTask, org.hl7.fhir.r4.model.QuestionnaireResponse beforeCreate)
    Override this method to modify the QuestionnaireResponse before it will be created in state QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS on the DSF FHIR server
    final void
    notify(org.camunda.bpm.engine.delegate.DelegateTask userTask)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultUserTaskListener

      public DefaultUserTaskListener(ProcessPluginApi api)
      Parameters:
      api - not null
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • notify

      public final void notify(org.camunda.bpm.engine.delegate.DelegateTask userTask)
      Specified by:
      notify in interface org.camunda.bpm.engine.delegate.TaskListener
    • beforeQuestionnaireResponseCreate

      protected void beforeQuestionnaireResponseCreate(org.camunda.bpm.engine.delegate.DelegateTask userTask, org.hl7.fhir.r4.model.QuestionnaireResponse beforeCreate)
      Override this method to modify the QuestionnaireResponse before it will be created in state QuestionnaireResponse.QuestionnaireResponseStatus.INPROGRESS on the DSF FHIR server
      Parameters:
      userTask - not null, user task on which this QuestionnaireResponse is based
      beforeCreate - not null, containing an answer placeholder for every item in the corresponding Questionnaire
    • afterQuestionnaireResponseCreate

      protected void afterQuestionnaireResponseCreate(org.camunda.bpm.engine.delegate.DelegateTask userTask, org.hl7.fhir.r4.model.QuestionnaireResponse afterCreate)
      Override this method to execute code after the QuestionnaireResponse resource has been created on the DSF FHIR server
      Parameters:
      userTask - not null, user task on which this QuestionnaireResponse is based
      afterCreate - not null, created on the DSF FHIR server