Skip to main content
July 26, 2023
Question

How can I start a process model from an interface (by clicking on a userimage) ?

  • July 26, 2023
  • 7 replies
  • 0 views

I have read the documentation and I think I have followed what is suggested but I still cannot start the process- from the interface.

this is the section of the interface where I am calling the process model:

a!sideBySideItem(
  item: a!imageField(
    images: a!userImage(
      user: local!currentuser,
      link: a!dynamicLink(
        value: local!imageuser,
        saveInto: a!startProcess(
          processModel: cons!GLP_UPDATEPROFILEPICTURE,
          processParameters: {
            userToUpdate: local!currentuser
          },
          onSuccess: a!save(
            target: local!imageuser,
            value: fv!processInfo
          )
        )
      )
    ),
    isThumbnail: true(),
    style: "AVATAR"
  ),
  width: "MINIMIZE"
),

7 replies

mikes0011
Brainy
July 26, 2023

This should start the process model pointed to by cons!GLP_UPDATEPROFILEPICTURE, assuming it's saved and published and the user has at least Viewer-level security for it.  I would point out, just in case your expectations are wrong, that a!startProcess() is asynchronous - meaning any process instance it launches will be in the background and mainly invisible to the user clicking the link.

Also I'll note that, as far as I can tell, local!imageuser probably isn't doing what you're expecting.  The "onSuccess" save is attempting to capture the *entire* fv!processInfo output into it, whether or not you mean to.  And setting it as the "value" parameter of the dynamicLink call will essentially do nothing (at least nothing directly useful).  But otherwise the configuration looks about right, presuming all the stuff I mentioned in the first paragraph here matches your expectations.

July 26, 2023

I have been trying several things and that is why I had that value in onSuccess. I just changed to:

value: fv!processInfo.pv.newPicture

Still, I do not see anything happening and the logs do not record anything. The interface is inside a site, as a page. Couldn't it be something I am missing in the process model? in the start node?

mikes0011
Brainy
July 26, 2023

To be clear, are you saying no Process Instances are started after the user clicks the link?