includePerform

A TaskElement represents an algorithm, which could have multiple implementations. Such implementations need to be performed, either via default code or custom code. The includePerform option adds a perform method, which can be modified to custom needs.

Default

When this option is not specified, no perform method is generated.

When this option is specified, perform method is generated with dummy code conform the taskElement specifications.

Value

When the option is specified, the value-field needs to be empty.

Examples

A perform method for a DossierPrefiller TaskElement

    public TaskResult<DossierDetails> perform(ParameterContext<DossierDetails> targetParameter) {
      UserContext userContext = targetParameter.getUserContext();
      TaskResult<DossierDetails> taskResult = TaskResult.success(null);
      if (logger.isDebugEnabled()) {
          logger.debug(
              "Performing the DossierPrefillerImpl implementation"
          );
      }
      try {
        // anchor:custom-perform:start
          DossierDetails value = targetParameter.getValue();
          try {
              performPrefill(value);
              taskResult = TaskResult.success(value);
          } catch (Exception e) {
              taskResult = TaskResult.error();
              logger.error(e.getMessage());
          }
        // anchor:custom-perform:end
      }
      catch (Exception e) {
        taskResult = TaskResult.error();
        if (logger.isErrorEnabled()) {
            logger.error(
                "Exception in DossierPrefillerImpl implementation", e
            );
        }
      }
      return taskResult;
    }