Wanna call my bussiness rule action in my post processing action , but it is acting as normal python function,i wanna create a workflow with two actions or one action one task, instead of robocorp actor, can anyone help me in this?
im using robocorp tool for my RPA this is the reference link for Robocorp RPA tool
from datetime import datetime
from zoneinfo import ZoneInfo
import json
import pytz
from sema4ai.actions import action
# from robocorp.tasks import task
# from robocorp.tasks import task
import json
from helper_funtions import *
@action
def business_rule1(data: str) -> str:
"""
Takes data and will do some business logic and return the updata data
Args:
data (str): string data
returns:
str: returns updates string
"""
data = data.replace('BOL_Number','test')
# data = json.loads(data)
return data
@action
def post_processing(pdf_path : str) -> str:
"""
Takes pdf path and communicates with an API and returns json
Args:
pdf_path (str): local path of the pdf file
Returns:
dict: retruns the dictionary got from the api with some transformations
"""
response = send_pdf_to_api(f"{pdf_path}","localhost:7009/extract_data/")
if response.status_code == 200: # Check for success
response_data = response.text
response_data = response_data.replace('json',"")
response_data=response_data.replace("```","")
shipping_data = json.loads(response_data)
shipping_data = json.loads(shipping_data["outputs"][0])
shipping_data = str(shipping_data)
print(shipping_data)
shipping_data = business_rule1(shipping_data)
return shipping_data