Return PM output when using startProcess in an expression rule instead of "Smart Service"

I'm trying to call startProcess within an expression rule but no matter what, the ouput is "Smart Service". I cannot call this startProcess feature from within my interface since the requirement doesn't allow for a button press. Therefore an expression rule must be triggered within a refreshVariable statement and it's output is set to a local variable within my interface.

example 1:

a!startProcess(
    processModel: cons!PM_Con,
    processParameters: {
      param: ri!param,
      param2: ri!param2
    },
    onSuccess: fv!processInfo.pv.data,
    onError: null
  )

example 2:

a!localVariables(
  local!return,
  a!startProcess(
    processModel: cons!PM_Con,
    processParameters: {
      param: ri!param,
      param2: ri!param2
    },
    onSuccess: a!save(local!return, fv!processInfo.pv.data),
    onError: a!save(local!return, null)
  )
)

  Discussion posts and replies are publicly visible

Parents
  • Thank you Stefan Helzle and rohito0002. My requirement is to update data on the UI based on a certain type of insert into a db table. So the basic flow is, db table gets updated, refreshVariable grabs updates from the table, triggers a PM to update local variables according to the db update. 

    I'm no expert appian developer so this is a POC at the moment. I will try out this suggested solution.

Reply
  • Thank you Stefan Helzle and rohito0002. My requirement is to update data on the UI based on a certain type of insert into a db table. So the basic flow is, db table gets updated, refreshVariable grabs updates from the table, triggers a PM to update local variables according to the db update. 

    I'm no expert appian developer so this is a POC at the moment. I will try out this suggested solution.

Children
  • 0
    Appian Employee
    in reply to jacobl825

    My main question is: how is the initial database table update happening? Is it occurring through an Appian process or an external system or is it triggered based on some user action on the interface? If it's occurring through an Appian process, I'd recommend just having any additional changes also happen in that process. If the database is updated outside of Appian, you could also have database triggers that are kicked off based on an initial insert into the table.

    Here's how I usually like to think about it:

    • If you want something in the interface to refresh based on a user action, then use the action (e.g. button click) to also update whatever else you want.
    • If you want the interface to passively view some change in an external system, then try to set up all of the processing outside of the interface (i.e. through a process model or database trigger).