how to schedule a process model from database insert or update

Certified Lead Developer

Hi Folks,

How can I schedule/ trigger my process model so that it will start on a row insert or update in da custom database table.

Regards,

Ghanashyam

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    HI, you can configure triggers in your start node of the process model based on timer. There you would get multiple options to configure the timer.

  • Yes, you can schedule a process. Check in the properties of the Start node and there you can find the timer trigger. 

  • 0
    Certified Senior Developer

    Hi Shyam,

    you can configure a timer in a PM  or if you have different type of process to trigger on different use case you will need more than a timer to server your use case. Once you make an entry to a DB (insert/update) , you can make 1 more entry on a new table which will decide to trigger which process or not ?.  once you done this you can configure a timer to trigger a process which which check the entry and trigger the respective process.

  • So I can't think of a direct way of triggering an Appian process model after an ON INSERT event in a database table. But with a little bit of work you could design in indirect method.

    This would involve having a process model that runs on a scheduled basis e.g. every 15 minutes (the period would be dependent on how often/soon you want to respond to your ON INSERT events i.e. how time sensitive you triggering pattern needs to be). This process model would fetch all instances of new news from the subject database table (so you'd need to add a column to indicate that the row was new and had not yet been processed). For every new row you could then start the process model that you want to trigger on the ON INSERT event. You'd also have to update the original row so that the next time your scheduled process runs it doesn't fetch the rows that it's already processed.

    You'd also need to think carefully about the volumes involved and consider a throttling mechanism so you don't end up starting so many instances of the process you need triggered that you run out of memory and kill the server.

  • 0
    Certified Lead Developer
    in reply to Stewart Burchell

    Hi Stewart,

    Thanks for the reply !! I thought the same approach but I assumed might be Appian giving some direct flexibility so that I don't need to poll my instances with a timer rather then instantiate only on the basis of database trigger. But now I am clear that there is no straight approach for it. Hopefully Appian will come up with some enhancement for this in near future.

    Regards,

    Ghanashyam

  • I can't speak for Engineering (who make the Appian product) but I suspect this isn't something they'd want to do, for two reasons. Firstly: there are multiple databases that Appian supports and the number of users who'd want this pattern is likely to be very small, Secondly: in effect you're embedding business logic in the database which is an anti-pattern. It'd be very hard to understand the end-to-end process if it is coupled at the database layer. But that's my personal view, not the official Appian Engineering position. 

  • 0
    Certified Lead Developer

    The question is where is the data being written from?  If it's being written from Appian itself, then have Appian kick off a process immediately after it does the write.  If the data is coming from salesforce or similar, you can configure that system to call Appian API or send email to Appian to start a process when it does a write.

    I agree that it's an anti-pattern to put business logic into your data container.  The trigger doesn't need to be IN the database to be a trigger.