run_data_rule
Execute data load rules in FCCS to manage financial consolidation data between specified periods with configurable import and export modes.
Instructions
Run a Data Management load rule / Executar regra de carga do Data Management
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_name | Yes | The name of the data load rule | |
| start_period | Yes | Start period (e.g., 'Jan-23') | |
| end_period | Yes | End period (e.g., 'Jan-23') | |
| import_mode | No | Import mode (default: REPLACE) | |
| export_mode | No | Export mode (default: STORE_DATA) |
Implementation Reference
- fccs_agent/tools/jobs.py:61-83 (handler)The main tool handler function that executes the 'run_data_rule' tool by delegating to the FCCS client.async def run_data_rule( rule_name: str, start_period: str, end_period: str, import_mode: str = "REPLACE", export_mode: str = "STORE_DATA" ) -> dict[str, Any]: """Run a Data Management load rule / Executar regra de carga do Data Management. Args: rule_name: The name of the data load rule. start_period: Start period (e.g., 'Jan-23'). end_period: End period (e.g., 'Jan-23'). import_mode: Import mode (default: REPLACE). export_mode: Export mode (default: STORE_DATA). Returns: dict: Job submission result. """ result = await _client.run_data_rule( _app_name, rule_name, start_period, end_period, import_mode, export_mode ) return {"status": "success", "data": result}
- fccs_agent/tools/jobs.py:127-156 (schema)The input schema and tool definition for 'run_data_rule' within the TOOL_DEFINITIONS list.{ "name": "run_data_rule", "description": "Run a Data Management load rule / Executar regra de carga do Data Management", "inputSchema": { "type": "object", "properties": { "rule_name": { "type": "string", "description": "The name of the data load rule", }, "start_period": { "type": "string", "description": "Start period (e.g., 'Jan-23')", }, "end_period": { "type": "string", "description": "End period (e.g., 'Jan-23')", }, "import_mode": { "type": "string", "description": "Import mode (default: REPLACE)", }, "export_mode": { "type": "string", "description": "Export mode (default: STORE_DATA)", }, }, "required": ["rule_name", "start_period", "end_period"], }, },
- fccs_agent/agent.py:143-146 (registration)Registration of the 'run_data_rule' handler in the central TOOL_HANDLERS dictionary."list_jobs": jobs.list_jobs, "get_job_status": jobs.get_job_status, "run_business_rule": jobs.run_business_rule, "run_data_rule": jobs.run_data_rule,
- Low-level FCCSClient method that submits the data rule job via HTTP POST to the FCCS REST API.async def run_data_rule( self, app_name: str, rule_name: str, start_period: str, end_period: str, import_mode: str = "REPLACE", export_mode: str = "STORE_DATA" ) -> dict[str, Any]: """Run data rule / Executar regra de dados.""" if self.config.fccs_mock_mode: return {**MOCK_DATA_RULE_RESULT, "jobName": rule_name} payload = { "jobType": "DATARULE", "jobName": rule_name, "parameters": { "startPeriod": start_period, "endPeriod": end_period, "importMode": import_mode, "exportMode": export_mode } } response = await self._client.post( f"/{app_name}/jobs{self._get_query_params()}", json=payload ) response.raise_for_status() return response.json()