Intermittent issue with null parameters for Spin Objects.

XMLWordPrintable

    • Type: Bug Report
    • Resolution: None
    • Priority: L3 - Default
    • None
    • Affects Version/s: None
    • Component/s: engine
    • None

      Environment (Required on creation):

      Centos running on AWS ECS

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      Occasionally when we are converting external task variables in a custom json payload we get an IllegalArgumentException unsupportedParameterType exception.

      Steps to reproduce (Required on creation):

      Get the variables for a recently fetched and locked external task:

          /**
           * Convert the external task to a workflow message
           *
           * @param externalTask External task
           * @return Workflow message
           * @throws ShutterflyException throw if business key is invalid
           */
          private WorkflowMessage convertExternalTask(LockedExternalTask externalTask) throws ShutterflyException {
              String businessKey = StringUtils.trimToEmpty(externalTask.getBusinessKey());
              String[] split = Utils.parseBusinessKey(businessKey);
              return WorkflowMessage.builder()
                      .id(split[0])
                      .type(split[1])
                      .attributes(Utils.convertVariablesToAttributes(externalTask.getVariables()))
                      .build();
          }
      

      And convert these to a custom json payload via this:

          /**
           * Convert process variables to attributes
           *
           * @param variables Process variables
           * @return WFED attributes
           */
          public static Map<String, Object> convertVariablesToAttributes(VariableMap variables) {
              Map<String, Object> nullSafeVariables = Optional.ofNullable(variables).orElse(new VariableMapImpl());
              Map<String, Object> attributes = new HashMap<>(nullSafeVariables.size());
              for (Map.Entry<String, Object> entry : nullSafeVariables.entrySet()) {
                  if (entry.getValue() instanceof SpinJsonNode) {
                      attributes.put(entry.getKey(), ((SpinJsonNode) entry.getValue()).unwrap());
                  } else {
                      attributes.put(entry.getKey(), entry.getValue());
                  }
              }
              return attributes;
          }
      

      Variables that would have been retrieved are attached. Was something other than that returned initially? The first time this ran for this particular external task instance it failed. Then the lock time expired and it retried and worked. How could that be?

      Observed Behavior (Required on creation):

      java.lang.IllegalArgumentException: UTILS-02001 Parameter 'parameter' is null
          at org.camunda.commons.utils.EnsureUtilLogger.parameterIsNullException(EnsureUtilLogger.java:25)
          at org.camunda.commons.utils.EnsureUtil.ensureNotNull(EnsureUtil.java:35)
          at org.camunda.spin.impl.SpinFactoryImpl.createSpin(SpinFactoryImpl.java:66)
          at org.camunda.spin.impl.SpinFactoryImpl.createSpin(SpinFactoryImpl.java:89)
          at org.camunda.spin.Spin.S(Spin.java:55)
          at org.camunda.spin.plugin.variable.value.impl.SpinValueImpl.getValue(SpinValueImpl.java:63)
          at org.camunda.spin.plugin.variable.value.impl.JsonValueImpl.getValue(JsonValueImpl.java:73)
          at org.camunda.spin.plugin.variable.value.impl.JsonValueImpl.getValue(JsonValueImpl.java:30)
          at org.camunda.bpm.engine.variable.impl.VariableMapImpl$2$1$1.getValue(VariableMapImpl.java:229)
          at com.shutterfly.camunda.util.Utils.convertVariablesToAttributes(Utils.java:126)
          at com.shutterfly.camunda.workflow.requester.RequesterService.convertExternalTask(RequesterService.java:331)
          at com.shutterfly.camunda.workflow.requester.RequesterService.sendSqsMessages(RequesterService.java:177)
          at com.shutterfly.camunda.workflow.requester.RequesterService.fetchAndLockTasks(RequesterService.java:139)
          at com.shutterfly.camunda.workflow.requester.RequesterService.lambda$pollAvailableTopics$0(RequesterService.java:106)
          at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source)
          at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
          at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
          at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
          at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
          at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
      

      Expected behavior (Required on creation):

      No exception.

      Root Cause (Required on prioritization):

      Unknown

      Solution Ideas (Optional):

      No idea

      Hints (Optional):

        This is the controller panel for Smart Panels app

              Assignee:
              Unassigned
              Reporter:
              David Drouin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: