Javacript within callActivity

I am trying to call javascript code within callActivity tag. However, when I run the code, it just skips the javascript code. What am I doing wrong here?

The code I tried:

 <callActivity id="Task_1ak11v2" name="Upgrade" calledElement="upgradedevice">
      <extensionElements>
        <camunda:inputOutput name="demo">
        <camunda:in name="test">
        
        <camunda:script scriptFormat="javascript"><![CDATA[
       
           print('hello world');
          
       
       ]]></camunda:script>
       </camunda:in>
       </camunda:inputOutput>
        <camunda:in businessKey="#{execution.processBusinessKey}"/>
        <camunda:in variables="all"/>
        <camunda:out variables="all"/>
      </extensionElements>
      <incoming>SequenceFlow_0ai2o4m</incoming>
      <outgoing>SequenceFlow_19doddz</outgoing>
      <multiInstanceLoopCharacteristics camunda:collection="selectedDevices" camunda:elementVariable="deviceName" isSequential="true"/>
    </callActivity>

Perhaps the list of selectedDevices is empty?

Hi ,
Thanks for response . I am using Java Delegate instead of javascript function .
Array function (in java code working fine )
sample selectedDevices =“A,B,C,D,E”

error message
ProcessEngineException: ENGINE-02025 Variable ‘selectedDevices’ is not from type ‘Collection’