Create Clickable Interface from Process Report

I would like to create a landing page for an app which displays data from a process report in a grid format. Clicking on a grid row will allow a user to complete remaining user input tasks for that process model instance. This page also needs a button that initiates a new instance of the process model.

I currently have an interface that correctly displays the process report data in a grid. However, I cannot figure out how to make this interface clickable to complete an active process instance. I also don't know how to create a button for this page that initiates a new instance of the process model.

Do I need to create a report or record type that references the process report, rather than an interface? Any resources for how to do this?

Please let me know any ideas or possible solutions.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    What exactly do you mean by "complete an active process instance"?  AFAIK you should be able to grab task IDs from any active instance your report returns and formulate task links to those.  I'm unclear what else you might be wanting to do since all of this sounds plausible on SAIL forms.

  • a!localVariables(
      local!pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: -1 
      ),
      local!report: a!queryProcessAnalytics(
        report: cons!Constant1,
        contextProcessModels: {
          cons!Constant2
        },
        query: a!query(
          pagingInfo: local!pagingInfo
        )
      ),
      
      a!gridField(
        label: local!report.name,
        instructions: local!report.description,
        data: local!report.data,
        columns: a!forEach(
          items: local!report.columnConfigs,
          expression: a!gridColumn(
            label: fv!item.label,
            sortField: fv!item.field,
            value: if(
              fv!item.configuredFormatting = "PROCESS_STATUS_ICON",
              a!imageField(
                images: choose(
                  /*Process status go from 0-4, so add 1 to index into the choose list */
                  1 + tointeger(index(fv!row, fv!item.field, {})),
                  a!documentImage(
                    document: a!iconIndicator( icon: "PROGRESS_RUNNING" ),
                    altText: "Active",
                    caption: "Active"
                  ),
                  a!documentImage(
                    document: a!iconIndicator( icon: "STATUS_OK" ),
                    altText: "Completed",
                    caption: "Completed"
                  ),
                  a!documentImage(
                    document: a!iconIndicator( icon: "PROGRESS_PAUSED" ),
                    altText: "Paused",
                    caption: "Paused"
                  ),
                  a!documentImage(
                    document: a!iconIndicator( icon: "STATUS_NOTDONE" ),
                    altText: "Cancelled",
                    caption: "Cancelled"
                  ),
                  a!documentImage(
                    document: a!iconIndicator( icon: "STATUS_ERROR" ),
                    altText: "Paused By Exception",
                    caption: "Paused By Exception"
                  )
                ) ),
                
                index(fv!row, fv!item.field)
            )
          )
        ),
        pageSize: 20,
        rowHeader: 1
      )
    )
     

    The attached code creates the grid I want in an Interface, which is being referenced in a Report. However, I am struggling to create a link in the Process ID column of the report. When I try to create a link by replacing value: with the code below or seeming anything else, I get the following error. 

    Expression evaluation error: Syntax error. Details: Expression evaluation error at function a!forEach parameter 2 [line 22]: Keyword and non-keyword arguments must not be mixed. Used in: gridcolumn

    value: a!linkField(
           links: a!processTaskLink(
             label: fv!row,
             task: fv!identifier
           )
         )
  • That seemed to work for a split second, but somehow no longer does. The attached code created my interface along with a clickable link column, and the grid momentarily populated as it should. However, when i saved and closed the interface, the data disappeared from the interface and the report that references the interface, so the grid is now blank. The attached code does not seem to have changed, and gives me no errors. Any ideas how that could be possible?

    a!localVariables(
      local!pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: 20 
      ),
      local!report: a!queryProcessAnalytics(
        report: cons!Constant1,
        query: a!query(
          pagingInfo: local!pagingInfo
        )
      ),
      a!sectionLayout(
        label: "Rating Cart Uploads",
        contents: {
          a!gridField(
            data: local!report.data,
            columns: {
              a!gridColumn(
                label: "Process ID",
                value: fv!row.c0
              ),
              a!gridColumn(
                label: "Status",
                value: fv!row.c1
              ),
              a!gridColumn(
                label: "Start Time",
                value: fv!row.c2
              ),
              a!gridColumn(
                label: "Link",
                value: a!richTextDisplayField(
                  value: {
                    a!richTextItem(
                      text: "(Process ID: " & fv!row.c0 & ")",
                      link: a!startProcessLink(
                        processModel: cons!Constant2,
                        processParameters: {
                          testParameter: fv!row.id
                        }
                      )
                    )
                  }
                )
              )
            }
          )
        }
      )
    )

  • 0
    Certified Lead Developer
    in reply to lukevg

    To clarify, do you see any data if you directly open the process report referenced by cons!Constant1?  The data you see there will be the direct source of your a!queryProcessAnalytics call, so if that's now blank then your SAIL grid would be, also.  You might want to make sure you didn't change the data source / filtering there to something unintentional.

  • Yes all of the data still displays in the process report. I do not have any filters, and all of the data sources still seem to be correct and unchanged. 

    Also, I created a record where the source is the process model. The record page says that there are 11 items, which is the same number of rows in the process report, but the grid is entirely blank. Does not seem like there are any filters there either.    

  • 0
    Certified Lead Developer
    in reply to lukevg

    Add a read-only Paragraph Field to your form (i.e. right above the grid), set its value to the value of local!report.  That'll tell you whether you're getting any queried data locally.  You could also copy and paste the queryProcessAnalytics call itself into a blank/unsaved Expression Rule editor and see what happens when you run it there.

  • local!report returns nothing. Not sure why bc the value of the constant is the process report and the process report data still displays as normal. Here is the local!report output:

    [startIndex=0, batchSize=0, sort=, totalCount=0, data=, identifiers=, name=My Process Report, description=, columnConfigs=, errorMessage=Empty context passed in for report My Upload Process Report [id=13156]. (APNX-1-4156-000)]

  • +1
    Certified Lead Developer
    in reply to lukevg
    errorMessage=Empty context passed in for report My Upload Process Report

    This tells you pretty much what you need to know.  If you edit the portal report you will see an associated Context, but you're not passing anything into your QPA call.  QPA expects either contextGroups, contextProcessIds, contextProcessModels, or contextUsers to be passed in as required depending on the type of portal report.  You might need to check the value of cons!

    Edit: I just noticed that in your older pasted code, you had a contextProcessModels value:

    whereas in your newer code, you don't have this parameter at all:

    I'm assuming this is probably the root of your current issue.

  • That was the issue. Thanks for your help! 

    Since I want the Link column to link to remaining process instance tasks rather than to start a new process instance, do I use a!taskProcessLink instead? 

    Do I also use a!startProcessLink to configure a Button that initiates a new process instance?

  • 0
    Certified Lead Developer
    in reply to lukevg

    In general that sounds about right -- a!processTaskLink() accepts the ID of an existing task instance and allows a user (with sufficient permission) to open, accept and complete that task.  And as you said, a!startProcessLink() allows a user to chain directly into a brand new instance of a processs.

  • Dear Sir,

    How to get the process instance details by using process Id, My requirement is when i click on process id i could open process instance based on process Id

  • What exactly do you mean by "open process instance"?  That sounds like something this thread isn't really talking about.

Reply Children
No Data