Before start > read the basic post about Novulo processes.
What are process components?
Sometimes a specific sequence of actions (so a part of a process) is executed multiple times in the same application. A Process component can be used to avoid having to design those sequences repeatedly. A Process component is a reusable container containing a sequence of actions. This is similar to how a function is a reusable expression.
Create a process component
Creating a Process component can be done using the startup screen. Click the root node of your application > click Process components > Add new process component.
If you define a component this way, the component is only defined and not used yet (not triggered, not called). You have to drag the component in a process via the context panel.
Inside the Process component, one can model actions just like normal processes. In the example underneath, certain aircraft data is edited to inactive and when that is successful a log record is added to keep a history of the activity of this aircraft. We can re-use this process component inside several, different aircraft maintenance processes.
Tip: do NOT try to edit the contents of a process component in the main process view. You can expand the component box with the [+]-button to see its internal actions, however, this is for viewing only. Always use the “Edit component” button to edit a process component.
Setting parameters and return values
A process component usually requires input and output parameters. The process component exists completely independent of any details page, so you must give it all information about which specific records you want to use.
For example, you should pass an Aircraft parameter to identify a particular aircraft. Output parameters can be used in the process, after the place you used the process component. In the aircraft example, you might want to return the date the aircraft is expected to return to active duty.
Parameters of the component are edited by double-clicking the component’s start node, or right-clicking it and selecting its properties.
Then, in the Component Parameters tab, you can add parameters and make them (not)required:
The result will be that, whenever the component is re-used in a process, it is necessary to set the “aircraft_param” parameter (because it was created as a reqquired parameter). Inside the component, the parameter is passed on to the component’s start node, and can be used in the component’s process.
To add a process component to a process on an aircraft, we add a button on the aircraft detail page, and go to its process:
Then we drag the process component from the context panel to the process editor:
Then we go to the properties of the Process component by clicking on the blue square, or right-clicking the component and selecting properties:
You should be in the Arguments tab. If not, go there. Press the fx button in the Value column to select a value for our parameter.
Via the context menu, navigate to “record” under “Process” and “Start”. This is refers to the record of this specific aircraft. Remember that a user can only see this detail page if he clicks on a specific aircraft in some way, for example by clicking it in a grid. Drag and drop the “record” to the expression placeholder, and press OK.
Now you should see “trigger.record” as your value (trigger is the internal name for the Process->Start part in the context menu):
Press OK to confirm your changes. You’ve added a parameter to a process component!