Question

Custom Package Development: How to Create Action Package that DOES NOT RETURN VALUE

  • 31 October 2022
  • 8 replies
  • 11 views

I am developing a custom package that simply executes some action. I do not want it to return a value as output.

 

The examples online from AA only discuss packages that have a return value.

 

I am getting this error when testing:

 

"Incorrectly typed data found for annotation element public abstract com.automationanywhere.commandsdk.annotations.CommandPkg$Returns[] com.automationanywhere.commandsdk.annotations.CommandPkg.multiple_returns() (Found data of type com.automationanywhere.commandsdk.annotations.CommandPkg.Returns[])"

 

Here are my annotations for the class:

 

image


8 replies

Badge +4

Remove the return_label and function annotated with @Execute should return void.

Sumit,

 

I took your advice. Below are my new annotations, as well as the method constructor where I am specifying the input. I am still getting an error after the adjustments.imageimage

Userlevel 2
Badge +6

@Logan Price​ Is the error still the same when trying to build? The approach @Sumit Kumar​ mentions should work, there's a few examples like setting a session or list that use void methods without the return annotation

 

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/developer/cloud-entry-list-example.html

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/developer/cloud-handle-session-custom-package.html

 

The only other workaround I can suggest is to set the return_require to false and return a boolean perhaps based on success of the execution. You'd then not have to assign anything to it within the task, although would be a lot cleaner doing it the way you're trying.

 

 

 

That cleared the compileJava error I was getting! Thanks!

Badge +4

I had similar issue with the lastest sdk(A360-package-sdk-2.5.0.zip), by just updating existing samples and rebuilding the project. Ensure Java version is 11 for your project, delete sample classes and keep your own then rebuild.

 

You could also use this version and this should not give you the error:

A360-package-sdk-2.4.1.zip

Badge +4

Select/Download version 11 in SDK and try rebuilding the project.

I too am using the sdk-2.5.0 from AA.

 

Here are my project settings - does this look correct per your statement?

image

Hi Paul,

Sumit suggested I select Java version 11 in the IntelliJ settings and rebuild. This worked to clear the error that I showed in my post!

Reply