I am using the Download datasubset plugin for generating download link of Excel

I am using the Download datasubset plugin for generating download link of Excel file from a Tempo Report.
I have created the rule which returns an ExportableDataSubset.

I get the error: Expression evaluation error at function 'getdatasubsetdownloadlinkfromrule' [line 20]: Error evaluating function 'getdatasubsetdownloadlinkfromrule' : 0.

I have ensured that the rule which returns Exportable Data Subset returns it correctly. Also went through the sample Application which demonstrates its usage. But I am not able to figure out the issue. For reference, I have attached the SAIL code in a text file to this post.

If anyone has used this plugin before, please check my code and let me know if I am doing it incorrectly. Please note that ri!input is of type Number(Integer). I have set it to Numeric Type as per the Sample Application given for the plugin

Issue_DownloadDataSubsetPlugin.txt

OriginalPostID-170148

OriginalPostID-170148

  Discussion posts and replies are publicly visible

Parents
  • @chetany Hi, the actual issue related to name is, the plugin is failing to search or parse the rule, when the rule's name starts with a number and that's what my findings conclude. So you could go ahead with including underscores, but please make a note that your rule doesn't start with a number(s). It's okay even if you have number(s) in the middle.

    Here are the technical details related to this feed entry with regards to problem in name of rule that is used to get exportable data subset in fn!getdatasubsetdownloadlinkfromrule():

    Line #53 in GetDataSubsetDownloadLinkFromRule.java is throwing an array index out of bounds exception

    Content asContent = cs.searchByRoot(baseId, ruleName, new ContentFilter(ContentConstants.TYPE_NON_DOCUMENT))[0];

    The API function 'searchByRoot' in ContentService interface accepts the rule name (after making a conversion on it) passed by us as a parameter and a regex of type text is the type of input. Not sure if this is failing to accept the text that starts with number.

    Logs:

    [http-/0.0.0.0:8080-8] ERROR com.appiancorp.rest.shared.AppianExceptionMapper - Internal Server Error on REST API invocation.
    com.appiancorp.process.expression.ExpressionRuntimeException$AppianExceptionProvider: Expression evaluation error in rule 'test_report' at function fn!getdatasubsetdownloadlinkfromrule [line 3]: Error evaluating function fn!getdatasubsetdownloadlinkfromrule : 0 (APNX-1-4198-000)
    \tat com.appiancorp.process.expression.ExpressionRuntimeException.(ExpressionRuntimeException.java:70)

    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    \tat com.appiancorp.ps.plugins.downloaddatasubsetfromrule.GetDataSubsetDownloadLinkFromRule.getDataSubsetDownloadLinkFromRule(GetDataSubsetDownloadLinkFromRule.java:53)

    Hope the above helps those who faces similar issue or tend to look at the plugin code to solve if it is an issue really.
Reply
  • @chetany Hi, the actual issue related to name is, the plugin is failing to search or parse the rule, when the rule's name starts with a number and that's what my findings conclude. So you could go ahead with including underscores, but please make a note that your rule doesn't start with a number(s). It's okay even if you have number(s) in the middle.

    Here are the technical details related to this feed entry with regards to problem in name of rule that is used to get exportable data subset in fn!getdatasubsetdownloadlinkfromrule():

    Line #53 in GetDataSubsetDownloadLinkFromRule.java is throwing an array index out of bounds exception

    Content asContent = cs.searchByRoot(baseId, ruleName, new ContentFilter(ContentConstants.TYPE_NON_DOCUMENT))[0];

    The API function 'searchByRoot' in ContentService interface accepts the rule name (after making a conversion on it) passed by us as a parameter and a regex of type text is the type of input. Not sure if this is failing to accept the text that starts with number.

    Logs:

    [http-/0.0.0.0:8080-8] ERROR com.appiancorp.rest.shared.AppianExceptionMapper - Internal Server Error on REST API invocation.
    com.appiancorp.process.expression.ExpressionRuntimeException$AppianExceptionProvider: Expression evaluation error in rule 'test_report' at function fn!getdatasubsetdownloadlinkfromrule [line 3]: Error evaluating function fn!getdatasubsetdownloadlinkfromrule : 0 (APNX-1-4198-000)
    \tat com.appiancorp.process.expression.ExpressionRuntimeException.(ExpressionRuntimeException.java:70)

    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    \tat com.appiancorp.ps.plugins.downloaddatasubsetfromrule.GetDataSubsetDownloadLinkFromRule.getDataSubsetDownloadLinkFromRule(GetDataSubsetDownloadLinkFromRule.java:53)

    Hope the above helps those who faces similar issue or tend to look at the plugin code to solve if it is an issue really.
Children
No Data