Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-5191

Task properties doesn't include values - only data types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 7.0.0.Final
    • jBPM 6.4.0.Final
    • Runtime Engine
    • None
    • NEW
    • NEW

    Description

      When tasks input/output is retrieved using the API - it doesn't include the actual values, but only data types.

      See attachment eD2h.png for a sample human task configured.

      This is the script I have used for retrieving input mapping values:

      System.out.println("before everything");
      if ( kcontext.getNodeInstance() instanceof org.jbpm.workflow.instance.node.HumanTaskNodeInstance) {  
      System.out.println("inside if");             
      org.jbpm.workflow.instance.node.HumanTaskNodeInstance y = (org.jbpm.workflow.instance.node.HumanTaskNodeInstance) kcontext.getNodeInstance();  
      org.jbpm.workflow.core.node.HumanTaskNode x = y.getHumanTaskNode(); 
      System.out.println("ht node keyset size:"+x.getMetaData().keySet().size());   
                                                                                                                                                 
       for (java.util.Map.Entry<String, String> in : ((java.util.Map<String, String>) x.getMetaData("DataInputs")).entrySet()) {      
      
      System.out.println("input key:"+in.getKey()+", input value:"+in.getValue()+", in value class:"+in.getValue().getClass()+", in value tostring:"+in.getValue().toString());            
      }}          
                                                                                                                                                                                                                                                                                                                                                                   
           }
      

      And this is the output I've got:

      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) before everything
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) inside if
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) ht node keyset size:9
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) input key:Skippable, input value:Object, in value class:class java.lang.String, in value tostring:Object
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) input key:Description, input value:java.lang.String, in value class:class java.lang.String, in value tostring:java.lang.String
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) input key:CreatedBy, input value:java.lang.String, in value class:class java.lang.String, in value tostring:java.lang.String
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) input key:TaskName, input value:String, in value class:class java.lang.String, in value tostring:String
      10:54:46,339 INFO  [stdout] (http-127.0.0.1:8080-7) input key:Content, input value:java.lang.String, in value class:class java.lang.String, in value tostring:java.lang.String
      

      As you can see instead of seeing Skippable - true, I see Skippable-Object.

      This has wider impact, because also jBPM services, which are consequently used in Kie Server uses this API.

      If I try to retrieve the task details for the same task when attached, via kie-server rest api, this is the result:

      GET http://localhost:8080/kie-server/services/rest/server/containers/Skippable/processes/definitions/CustomDataRemote.CustomDataProcess/tasks/users

      <user-task-definitions>
      <task>
      <task-name>test</task-name>
      <task-priority>0</task-priority>
      <task-created-by>java.lang.String</task-created-by>
      <task-skippable>false</task-skippable>
      <associated-entities>
      <associatedEntities>anton</associatedEntities>
      </associated-entities>
      <task-inputs>
      <entry>
      <key>Description</key>
      <value>java.lang.String</value>
      </entry>
      <entry>
      <key>CreatedBy</key>
      <value>java.lang.String</value>
      </entry>
      <entry>
      <key>TaskName</key>
      <value>String</value>
      </entry>
      <entry>
      <key>Content</key>
      <value>java.lang.String</value>
      </entry>
      <entry>
      <key>Skippable</key>
      <value>Object</value>
      </entry>
      </task-inputs>
      <task-outputs/>
      </task>
      </user-task-definitions>
      

      Another consequence is that Skippable will be always set to false, because this call
      https://github.com/droolsjbpm/jbpm/blob/738d191d338dab3e8baceeaf6fe31556b81fe07f/jbpm-services/jbpm-kie-services/src/main/java/org/jbpm/kie/services/impl/xml/ServicesProcessDataEventListener.java#L98

      Will have these values:

                  task.setSkippable("true".equalsIgnoreCase("Object"));
      

      And that will always result to false

      Attachments

        Issue Links

          Activity

            People

              swiderski.maciej Maciej Swiderski (Inactive)
              swiderski.maciej Maciej Swiderski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: