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
  • 0
    Certified Lead Developer

    As mentioned by Stefan , A process can only be triggered from the saveInto of a component or in a Web Api .
    From your requirement i see you want to trigger a process from the expression rule . A possible solution which you can use is.

    Step 1 - Create a web api which triggers your process model
    Step 2 - Create an integration object and call the web api which you created in step 1
    Step 3 - Call this Integration object from the Expression Rule

    Hope this helps

Reply
  • 0
    Certified Lead Developer

    As mentioned by Stefan , A process can only be triggered from the saveInto of a component or in a Web Api .
    From your requirement i see you want to trigger a process from the expression rule . A possible solution which you can use is.

    Step 1 - Create a web api which triggers your process model
    Step 2 - Create an integration object and call the web api which you created in step 1
    Step 3 - Call this Integration object from the Expression Rule

    Hope this helps

Children