Custom script getting 'unable to launch bot' error

Hi,

I am new to Workfusion. When trying to run a custom script I am getting unable to Launch a bot task error, reason: content is not allowed in prolog.

Please advise
Thanks
Jacob

Hello @jacob. Welcome to our Community!! :smiley:
Could you please share your custom script? And the exception that you received.
Thank you in advance.

Hi Lera,
Thanks for your reply.Please find the below script.

<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config" scriptlang="groovy">
    <robotics-flow>
        <robot driver="universal" close-on-completion="true" start-in-private="true">
            <capability name="SEARCH_ALL_WINDOWS" value="true" />
            <script><![CDATA[
                import com.workfusion.studio.rpa.recorder.api.internal.representation.*
                import com.workfusion.studio.rpa.recorder.api.*
                import com.workfusion.studio.rpa.recorder.api.types.*
                import com.workfusion.studio.rpa.recorder.api.custom.*
                import static com.workfusion.studio.rpa.recorder.api.RandomValues.CharacterSet.*
 
                 input_list = RList.of('z','b','c')
                 sorted_list = RList.of()
                 
                  def customScript(){
                 		 sorted_list = RList.of(input_list.sortof())
                  }
                // defining recorder variables (needed only in Studio)
         customScript()
         sorted_list.each {
         println it
         }
            ]]></script>
        </robot>
    </robotics-flow>
    <export include-original-data="true"/>
</config>

Regards
Jacob

Thanks, Jakob.
Did you try to test your script in Bot task? If yes, you need to correct your code according to this guide: https://kb.workfusion.com/display/RPAe/Script+as+Custom+Action#ScriptasCustomAction-InWorkFusionStudio(Optional).
I see that you missed piece where input and output variables are defined.

Hi Lera,
I am not able to run my script due to the below error

Thanks for sharing the exception. Did you correct the script as I mentioned above?

Hi Lera,
i have already declared the input and output variables. Please find those highlighted in red

Thanks, but they are not satisfied the format of script from this guide: https://kb.workfusion.com/display/RPAe/Script+as+Custom+Action#ScriptasCustomAction-InWorkFusionStudio(Optional)
Also I noticed that you missed the first symbol - < - in the first row in your script:
image
Please correct your script according to the example from link above.

2 Likes

Hi Lera,

Thanks . Its working

2 Likes

Glad to know that I could help you! :blush: