215291 - no subject - Hi All, I am in version 7.4, I am using

Hi All, I am in version 7.4, I am using the getPortalReportDatasubset function when I am trying to read a Task Report, and Getting the First Task ID by using data[15].cells.value[1]. I am using this on click of a button to get the Task ID, to be saved into the local! variable in a SAIL code, this works perfectly fine,But when I try to execute the output in the Expression rule this is giving me an Empty result, Is there a problem with this function , or I am missing something, Could someone guide me.

TIA

OriginalPostID-215291

  Discussion posts and replies are publicly visible

  • @harshav As per my understanding of the issue, though you are able to get the expression working in SAIL, you aren't able to do it when it comes to the process. If so, may I please know how you have made configurations in the User Input Task/Script Task in the corresponding process? That is, did you create a input (in the User Input Task/Script Task) in the Inputs tab (If so, what is the data type of the input?) and reading the values in the Outputs from the ACP?
  • @sikhivahans, I am not trying open this in process but I am trying the piece of code in expression rule. and here is my code
    =getPortalReportDatasubset(
    reportId: cons!EX_REPORT,
    pagingInfo: ri!pagingInfo,
    contextIds: {},
    filter: {}
    ) and this report contains only filter which is show active flag true, and this is working fine when I am trying to hit a button and get the value, but Not in Expression rule, Please advise.
  • @harshav Do you mean to say that you are unable to see any results when you test the above code snippet in an expression rule?
  • Exactly sikhivahans , hoping you will pull me out of this issue :)
  • No issues, I will try as much as I can :). May I please know the category(Tasks Per Process, Process Details Per Process Model) of the report?
  • @harshav So as far as my observations are considered, the report you are making use of belong to a category where the User object acts as a context and I came to this conclusion as you aren't making use of the 'contextIds' argument. If we carefully observe the code snippet(specified by you in the previous comments), only two arguments namely reportId and pagingInfo are being used and I believe these wouldn't cause a problem definitely as these are pretty straight forward and simple configurations. I am assuming that the Document (Portal Report) object is accessible to all the users under whom the query needs to be made.

    So the issue could be with the context which is substituted with logged in user during the execution of the function. There shouldn't be any problem with the context as long as you execute the expression from the Designer Interface (Context is Logged In User) or SAIL interface (Context is Logged In User or Task Owner) as the context is quite clear. To the best of my knowledge, the expression behaves differently only when it's used else where because the context varies based on the place in which the expression is being utilised. Documentation at https://forum.appian.com/suite/help/16.2/User_Contexts_for_Expressions.html speaks re how the context varies in various places.

    So let's take the code snippet of yours as an example. Assume that you have assigned a task to me in which the code snippet will be executed upon interaction with a SAIL component. Then the code snippet will be executed with @sikhivahans as context. If you execute the same code snippet in the designer portal, it will be executed with @harshav as the context. Now let's say the same code snippet is included in the script task in the process model that is designed by a user namely john.doe and let's say the node is configured to run as designer. In this case, the code snippet will be executed with @john.doe as context. In case, if the node is configured to run as initiator, the same code snippet will be executed with pp!initiator as context. In all these cases, there is a chance for significant variance in the results as the context is varying.

    I have used the Portal to SAIL plugin extensively and as far as my experience is considered, there isn't any problem(except Performance).
  • My Report is Tasks Per Process Model, Sorry for the later Response.
  • I should thank you for typing such a big explanation, for my issue, and for your patience,will this be the case for the Tasks per process model also as, I have given the context as 2 PMS in the context while defining the portal report, and in the documentation of the getportal........ function the contextids are optional., Sorry for troubling you a lot sikhivahans :)
  • @harshav To the best of my knowledge, I don't think the user context has got anything to do in this case.

    The context (Process Models as per your use-case) you provide in the Portal Report are just for saving the Report. It doesn't really how many process models you provide as context as the context is ultimately obtained from the getportalreportdatasubset().

    Also I believe that the context needs to be provided because context becomes optional only in case when the category of report expects User as context. So I would suggest populating the contextIds argument with processModelIds. May I know if you are executing the expression from Designer Portal?