Skip to main content
February 11, 2022
Question

Best way to call process models in changing sequences

  • February 11, 2022
  • 5 replies
  • 0 views

I would like to know if the following scenario is possible within Appian, and if so how to accomplish it efficiently:

I would like to establish a set of process models that each perform a certain function. 

I would like to make an interface that my users can use to create a template and order those process models however they like, then save that sequence for later use by themselves and others.

Finally, I would like those users to be able to run that sequence of process models on demand.

Is this possible, and what would be the best way to accomplish it without resorting to crafting a new master process model every time? 

5 replies

stewart.burchell
February 11, 2022

Whilst the community digest this and think of ways to approach it, what's the actual business use case here? I ask because it maybe that there are alternate approaches to the problem or, possibly, that it'[s not even a problem to solve e.g. it may not actually matter what order the processes are executed in and therefore it's not a problem that needs to be solved. But without the actual context it's hard to appraise. (btw - I can think of some options already but would need further information such as do all/any/none of the process models need to run synchronously for the user to interact with?)

February 11, 2022

Thanks for the quick response! As an example, please consider the simplified process of performing an employee review:

Department A would like this sequence:

1. Employee will receive a self-evaluation to complete
2. A department specialist reviews average salaries for the employee's position and turns in a report
3. The supervisor turns in an employee evaluation

Department B would like the same tasks in order 2, 1, 3, Department C would like the same tasks in order 3, 1, 2 and Department D says all three can happen in parallel. Each task is independently completed by a process model - I'm looking for the best way to call them in a sequence (or in parallel) as dictated by the user. 

stewart.burchell
February 11, 2022

For me the example suggests that order doesn't really matter, but that all 3 need to be completed before the next step (which I presume is the actual Employee Review meeting)

To answer the actual question: for a relatively trivial example like this you could implement a parent process that takes as input the order that the processes need to be run, and a gateway (XOR) that routes through to the next sub-process depending on a) the order and b) the completion of any previous sub-process. So you'd need something to determine the order, and something to track the current state.

It might also be feasible to use a Decision Rule that takes a token that represents a process model and returns that model. You can then call the model using the Start Process smart service (it gets a bit hairy when each model has different rule inputs that you need to account for). You'd still need your parent model to know where in the sequence you are AND you need any given called model to tell the parent model that it has completed (tricky when it's called asynchronously, but not impossible - you could use process messaging to implement such a control)