Skip to main content
Question

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

  • October 31, 2022
  • 8 replies
  • 208 views

LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12

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

Forum|alt.badge.img+6
  • Navigator | Tier 3
  • 142 replies
  • November 1, 2022

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


LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12
  • Author
  • Most Valuable Pathfinder
  • 77 replies
  • November 1, 2022

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


Paul Hawkins
Forum|alt.badge.img+7
  • Navigator | Tier 3
  • 1078 replies
  • November 2, 2022

@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.

 

 

 


LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12
  • Author
  • Most Valuable Pathfinder
  • 77 replies
  • November 2, 2022

That cleared the compileJava error I was getting! Thanks!


Forum|alt.badge.img+6
  • Navigator | Tier 3
  • 142 replies
  • November 2, 2022

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


Forum|alt.badge.img+6
  • Navigator | Tier 3
  • 142 replies
  • November 2, 2022

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


LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12
  • Author
  • Most Valuable Pathfinder
  • 77 replies
  • November 2, 2022

I too am using the sdk-2.5.0 from AA.

 

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

image


LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+12
  • Author
  • Most Valuable Pathfinder
  • 77 replies
  • November 2, 2022

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!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings