How to cast to type Process Model?

Certified Associate Developer

How can I cast a value to datatype "Process model"?

I want to dynamically start a process model using

a!startProcess(processModel, processParameters, onSuccess, onError). I know that I can create a constant of type process model and pass it to parameter processModel.

However I would like to make it more dynamic, so that I need not create a constant everytime I want to call a new process model in future. Instead, planning to store the process model ID number in database and type cast it to "process model" and pass it as a parameter to a!startProcess().

I learnt that casting to type "Process Model"is not available in https://docs.appian.com/suite/help/19.3/Casting.html#general-casting, and anything that is not the list cannot be cast or will throw an error. Could anyone please let me know if there is any way we can achieve this. 

I also learnt that we can make the design dynamic by using decision tables to map Process models and then use Start Process Smart Service. However, if I want to call a new process in future, I will still need to make changes to the decision table and deploy a new version. So, I am checking for getting the database approach I mentioned and using a!startProcess().

Thanks in advance!

  Discussion posts and replies are publicly visible

Parents
  • Just an observation - I've seen this sort of pattern implemented in other languages/platforms and whist it is clever and flexible it can be really hard to debug when it goes wrong. Given that you can't dynamically create a process model at run time (which would be a frightening prospect!) then I'm not sure why living with a static model isn't palatable? You have the option of using a Appian Decision to dynamically return references to Process Models based upon rules (although you can only execute the using the Start Process smart service and therefore asynchronously by default). 

Reply
  • Just an observation - I've seen this sort of pattern implemented in other languages/platforms and whist it is clever and flexible it can be really hard to debug when it goes wrong. Given that you can't dynamically create a process model at run time (which would be a frightening prospect!) then I'm not sure why living with a static model isn't palatable? You have the option of using a Appian Decision to dynamically return references to Process Models based upon rules (although you can only execute the using the Start Process smart service and therefore asynchronously by default). 

Children
No Data