xule
xule copied to clipboard
Troubleshooting XULE Script Execution Error with Arelle on Amazon Linux 2
I'm evaluating the XULE plugin with Arelle on Amazon Linux 2, using Python 3.8. My script, successfully executed in XMLSpy 2024, aims to analyze hierarchical XBRL instances for journal entries, using dimensions to define journal headers, lines, and sub-account details. However, while compilation appears successful, running the script with --xule-run
results in an error. The script calculates debit and credit travel expenses, showing promising results when tested elsewhere:
namespace cor=http://www.iso.org/awi21926_jisc
output TravelExpense
$DebitEntries = set({covered @concept=cor:JISC04b_GL03_06 where $fact==true}.dimensions())
$CreditEntries = set({covered @concept=cor:JISC04b_GL03_06 where $fact==false}.dimensions())
$TravelExpenses = set({covered @concept=cor:JISC04b_GL03_01 where $fact=='726'}.dimensions())
$totalDebitTravelExpenses = sum(list({covered @cor:CC04w_01 where $fact.dimensions() in $DebitEntries and $fact.dimensions() in $TravelExpenses}))
$totalCreditTravelExpenses = sum(list({covered @cor:CC04w_01 where $fact.dimensions() in $CreditEntries and $fact.dimensions() in $TravelExpenses}))
"The total travel expenses are Debit:{$totalDebitTravelExpenses} JPY Credit:{$totalCreditTravelExpenses} JPY"
Successful output in XMLSpy 2023:
Successfully executed XULE on JISCinstance.xbrl in 16ms
[TravelExpense] The total travel expenses are Debit:28,096 JPY Credit:None JPY
On Arelle, compilation feedback is positive, but execution fails:
(arelle-env) [ec2-user Arelle]$ python arelleCmdLine.py --plugins xule --xule-compile /home/ec2-user/UADC/data/xule/travel_expense.xule --xule-rule-set /home/ec2-user/UADC/data/xule/travel_expense.zip
[info] Activation of plug-in XBRL rule processor (xule) successful, version Check version using Tools->Xule->Version on the GUI or --xule-version on the command line. - xule
[info] Xule version: 3.0.23722 -
2024-03-24T14:02:47.357186: travel_expense.xule parse start
2024-03-24T14:02:47.932898: travel_expense.xule parse end. Took 0:00:00.575712
2024-03-24T14:02:47.933101: travel_expense.xule ast start
2024-03-24T14:02:47.933378: travel_expense.xule ast end. Took 0:00:00.000277
2024-03-24T14:02:47.933405: post parse start
2024-03-24T14:02:47.934987: post parse end. Took 0:00:00.001582
2024-03-24T14:02:47.936886: Parsing finished. Took 0:00:00.581420
(arelle-env) [ec2-user Arelle]$ python -m arelle.CntlrCmdLine --plugin xule --xule-run --xule-rule /home/ec2-user/UADC/data/xule/travel_expense.zip
[info] Activation of plug-in XBRL rule processor (xule) successful, version Check version using Tools->Xule->Version on the GUI or --xule-version on the command line. - xule
[info] Xule version: 3.0.23722 -
[xule:error] rule TravelExpense: 'all' -
(arelle-env) [ec2-user Arelle]$
Could you review my approach to ensure it's correct? I'm looking to refine this process before advancing to XINCE for trial balance reporting. Your insights on proceeding with this test would be greatly appreciated.