Bot task error in custom script

I exported my code to BOT Task. My code is running fine. When I export it to exported successfully and after I saved the it. It has an error and I am trying to run the bot task and I have this error

Can anyone help me?

Hello @rodel.sarate.
Do you use Express Edition? Also could you please clarify whether you created your script in Actions flow and then exported to bot task? If yes, why did you do this? You can run your script directly from Actions Flow using “Play recording” button without exporting to bot task:
image

I can run using Play recording. I exported to bot task because I can’t publish to control tower directly, I am getting error.

image

When I try to save after successfully exported I got an error. It works perfectly using Play recording I want this to be in control tower to schedule.

I exported to bot task so that I can copy the code

image

after copying the code and creating a BP in control tower and running it I am getting this error

This is the custom script where it causing an error

@CustomScriptAction(
    input = ['sku_width','sku_height','sku_weight','sku_length', 'cnvy_abbreviations'],
    output = 'sku_cnvy'
)

def customScript() {

	def length = RNumber.fromRepresentation(sku_length,"0.0000;en-US")
	def width = RNumber.fromRepresentation(sku_width,"0.0000;en-US")
	def height = RNumber.fromRepresentation(sku_height,"0.0000;en-US")
	def weight = RNumber.fromRepresentation(sku_weight,"0.0000;en-US")
 
   if((cnvy_abbreviations==RString.of("Y")) && (length<=36) &&  (length>=9) && (width<=30) && (width>=6) && (height<=30) && (height>=2) && (weight<=47) && (weight>=2)) {
      sku_cnvy = RString.of("Y")       
   } else {
      sku_cnvy = RString.of("N")
   }
}

Hello @rodel.sarate,

There is no any difference whether you publish recording or bot task to Control Tower. Can you please try to switch it off, then turn on and after several minutes to publish again?

Regarding this, please check whether all requirements are met according to this guide - https://kb.workfusion.com/display/RPAe/Script+as+Custom+Action#ScriptasCustomAction-InWorkFusionStudio(Optional). Custom script action is not exported as-is, you need to do some changes with your code in bot task.

Hi @Lera,

I have tried turning off the Server no luck, restarting PC no luck, uninstall and install back the workfusion and no luck still my recording still cannot be published to control tower. That is the reason I have exported it as I read from posts in forum about this issue to export it to bot task and copy the code and create BP in control tower.

I don’t know about what requirements that you are talking about. this is the code I have in custom script after export to bot task.

@CustomScriptAction(
		input = ['sku_width','sku_height','sku_weight','sku_length', 'cnvy_abbreviations'],
		output = 'sku_cnvy'
   )

def customScript() {

		def length = RNumber.fromRepresentation(sku_length,"0.0000;en-US")
		def width = RNumber.fromRepresentation(sku_width,"0.0000;en-US")
		def height = RNumber.fromRepresentation(sku_height,"0.0000;en-US")
		def weight = RNumber.fromRepresentation(sku_weight,"0.0000;en-US")

		if((cnvy_abbreviations==RString.of("Y")) && (length<=36) &&  (length>=9) && (width<=30) && (width>=6) && (height<=30) && (height>=2) && (weight<=47) && (weight>=2)) {
				sku_cnvy = RString.of("Y")
		} else {
				sku_cnvy = RString.of("N")
		}
}

// Do not remove! Custom action customScript will be invoked here.
customScripActionCall_customScript: {} 

Can you elaborate what requirements needed? I created the custom script in recorded and export the project to bot task. I have more custom script.but I see the error in that CustomScript.

Thanks

Please advise which version of Intelligent Automation Cloud (RPA Express) you installed. You can check it in Control Panel - Programs and Features. Could this be that you installed only separate WorkFusion Studio?

Hi @Lera

image

Thank you. Please send files from folders (you can zip into 2 archives):

  • C:\RPAExpress\Agent\Logs\
  • C:\RPAExpress\Workfusion\tomcat\logs\

I can’t upload it here file size is big

here is the link to the logs. I uploaded it in Google Drive and shared it:

Hi @Lera

I still have the problem

Hi @rodel.sarate.

I checked on my side and cannot reproduce this exception. Please advise whether you have several custom scripts or only one. Is it possible to send a whole script code from your bot task (or even .rpae file), not only Custom script?

As about your issue with publishing, I see that Control Tower was started as usually and didn’t find any exception in its logs. For further investigation I need file C:\RPAExpress\Studio\logs\studio.log.

Thank you in advance.

Hi @Lera

I sent you the file in private message.

I have multiple custom script and I renamed all method to be different for each of the scripts

Thanks

1 Like

Hi @Lera

Any feedback? I have no other way to get it solved. :slight_smile:

Hi @rodel.sarate.

Can you please send event logs from Control Tower when you received the exception? Is it still the same?
As about unavailability to publish to Control Tower, please check whether your PC meets our System Requirements.

Hi @Lera
I only can’t publish this specific recording. other recording I can publish it to control tower.

Thank you. Unfortunately cannot reproduce your issue, your recording was successfully published to local Control Tower in the latest version - 2.4.0. Maybe, you tried to publish it to remote Control Tower? Or even to SPA?

Hi @Lera

I only use to local Control Tower. I don’t have remote control tower. Any suggestion to fix this issue?

Can you please try to update till the latest version - 2.4.1 and then check how it works after that?

Hi @Lera Should I uninstall to remove all failed exported? every time I export and failed it creates a new process.

Or just update?

Hi @Lera

I have this error

image

When I check the Control Tower

the process is there

and in my Server Profile

image