Creating Process Definitions
A process definition is a Repository object that defines a process to be executed by a process server. Every process that is submitted is the request of the execution of a single process definition. Redwood Server ships with a number of definition types, which define the programming language and target platform of the commands to be executed.
A process can raise one or more events when it reaches a specific status or return code. The events to be raised can be specified in the process definition.
Process definitions can be made dependent upon specific events. These processes cannot be executed before the events upon which they are dependent are raised. They will remain in Event Wait status until all dependent events are raised.
Parameters enable process definitions to define generic command texts that behave differently, according to the values of the parameters. For these parameters, validation rules can be added by defining simple constraints on the parameters.
Restart behavior is used to break or continue the submit frame when something unexpected happens. When you break the submit frame, the process or chain does not get submitted again according to the submit frame. By default, a Completed process or chain will continue to get submitted according to the submit frame.
Special care needs to be taken when you edit a process definition which is currently being (re)scheduled; the new process definition will take effect on all processes that have not reached the Dispatched status at modification time. Please see the Editing Process Definitions and Chain Definitions Safely section.
Tab-Specific Topics
Tab | Relevant topic |
---|---|
Definition | Source |
Parameters | Process definition parameters Parameter validation Using Table Parameters |
Parameter validation | Parameter validation |
Retention | Setting the Retention Period for Processes |
Control | Setting the Scheduling Behavior |
Options | Setting Process Definition Options |
Wait Events | Process Definition wait events |
Raise Events | Process Definition raise events |
Locks | Process definition locks |
Runtime Limits | Process definition runtime limits |
Status | Process definition restart behavior |
Actions | Process definition actions |
Published Web Services | Connecting Web Services with Redwood Server |
Process Monitor Updates | Creating Process Monitors |
File Searches | Searching Files |
Security | Process definition object privileges(PrivRequJobDefs) |
Process Definition Editor Modes
The process definition editor has two modes, Editor and Studio modes. In the editor mode you set properties such as the source code; in the process definition studio, you save your changes and submit the process definition with your latest changes. The process definition editor is opened in editor mode by default, you access the studio mode by choosing the icon in the upper right-hand side of the editor. The files stdout.log and stderr.log are displayed in the studio as soon as the process has completed. You adapt the source directly in the studio, save your changes and submit the process.
For example, a process definition with the following source will print Hello World to the stdout.log and stderr.log files:
{
jcsOut.println("Hello world");
jcsErr.println("Hello world");
jcsOutLog.info("Hello world");
jcsErrLog.info("Hello world");
}
Note that the studio relies on autoflush to be enabled for the Logger, which is the default. If you disable autoflush, the output will not be available in real-time; this also affects inspecting output and log files from running processes in the monitor.
Context-Menu
Process definitions have the following context-menu actions:
Action | Description |
---|---|
Submit | Submit the process definition via the submit wizard; this action is only available for top-level process definitions. |
Cancel non-final state processes | Cancel processes that have not reached a final state, see the States section for more information on states. |
Edit | Edit the process definition. |
Edit Submit form | Edit the submit form of the definition. |
Edit Security | Edit the privileges for this object. |
Edit Web Services | Edit the web services associated with this process definition. |
Duplicate | Duplicate the process definition, only custom and some built-in process definitions can be duplicated. |
Reset Statistics | Reset the runtime statistics for processes from this process definition. |
Delete | Delete the process definition, only custom process definitions can be deleted. |
Delete final state processes | Delete processes that have reached a final state, see the States section for more information on states. |
Monitor related processes | Jump to the processes monitor with a temporary filter displaying processes for the process definition. |
Show Statistics Report | Display a runtime statistics report with overall status, runtime, average and standard deviation. |
Export > Export | Export the process definition, only custom process definitions can be exported. |
Export > Export with related objects | Export the process definition including referenced objects, only custom objects can be exported. |
Promote > Promote to system | Promote the object to a remote system. |
Promote > Edit further then promote | Edit the export rule set prior to promoting. |
Show permalinks | Show the permalinks to this object, which can be used to access it from third party web applications. |
Add to navigation bar | Add the object to a navigation bar. |
New process definition | Create a new process definition. |
New (from Template) | Create a new process definition from a template. |
New (from Report) | Create a report definition. |
Import Web Service | Import a web service and schedule it like any other process definition. |
Filter > New Filter | Create a new filter. |
Filter > Edit Filter | Edit current filter. |
Filter > Delete | Delete current filter. |
Filter > Duplicate Filter | Create a copy of the filter. |
Filter > Export Filter | Export the filter into a CAR file. |
Filter > Add to navigation bar | Add the filter to a navigation bar. |
Filter > Create filter from search | Create a filter from the current IntelliSearch query. |
Compulsory Fields
Some fields need to be filled, like the Process Definition Name field, which is the only field that does not have a default and that needs to be filled for every definition type. Other definition types additionally require other fields be filled. For example, RedwoodScript process definitions need to have the Source field filled with at least the following: {}
. Furthermore, the source is not editable in process definitions of certain types, like the SAPR3 type, for example. The keep clause, which by default will keep all processes of the process definition, is also compulsory and needs to be changed if you want the system to automatically delete old processes.
note
The source cannot be edited for all job definition types, other job definition types require a specific license key. See the Editing the Process Definition Source section for more information.
Finding Process Definitions
You can search for process definitions using filters and the Search Process Definitions box on the process definitions tab. This box is known as the IntelliSearch box and located under your username on the top right-hand side of the user interface. Filters allow you to specify a list of objects with static criteria. IntelliSearch allows you to specify complex queries in a simple way using prefixes. Prefixes are used to specify which property you are searching in and have short as well as long syntaxes. For example, if you want to display all process definitions with the term import in the comment, you would use the search criteria as follows:
c:import
You can search more than one property, as follows:
c:import n:System
note
No spaces should be entered before or after the colon (: ).
See the Advanced Object Search for more information.
The following table illustrates the available prefixes for process definitions:
Prefixes | Description |
---|---|
n, name | searches the name property |
c, comm, comment | searches the documentation property |
d, desc, description | searches the description property |
a, application | searches the application property |
cb, changedbefore | (internal) search for process definitions that changed before a certain ISO-8601 period |
Deleting Process Definitions
You can only delete process definitions when no other objects relate to them. For example, if the process definition is called in a chain process, the process definition cannot be deleted until all chain processes using it have been deleted. You can see all chain processes that relate to the process definition in Related Objects in the lower detail pane and on the show page. Furthermore, processes of a process definition will prevent you from deleting the process definition. These are found by selecting Show Related Processes from the context-menu. It is also possible to cancel and delete related processes from the context-menu.
The table in related objects contains three columns:
- Type - the type of object, like process for chain process, Source for the source of the process definition with a link to it
- Related Object - the name of the object with a link to it
- Used As - objects can sometimes be used in different roles
Process definitions that are called in chains will have the call-reference in Related Objects. The type will be Job, and the Related Object will be the name of the chain process. For example, if it is the first chain process in a step, it will be Job 1.
Security
The following privileges are available for process definitions:
Privilege | Description |
---|---|
JobDefinition.Create | Create process definition |
JobDefinition.Delete | Delete process definition |
JobDefinition.DeleteJob | Delete jobs |
JobDefinition.Edit | Edit process definition |
JobDefinition.SubmitJob | Submit jobs |
JobDefinition.View | Access process definition |
You can grant privileges on two levels, Access and Admin; a privilege granted on Admin level allows the grantee to grant the privilege to other users. These privileges can be granted per partition or system-wide. Note that to be able to schedule a process, the user also needs privileges on the queue and other objects referenced by the process definition.
The Security tab allows you to specify which users can access, edit and delete the process definition.
Editing XML Source
You can also edit the XML source directly or copy it into your editor of choice. This is especially handy when you want to perform repetitive tasks such as a Search and Replace. You enable the XML source tab in the user options by enabling the Allow edit as XML option; see Setting User Parameters. Special care needs to be taken when you edit in XML, as you will have to use entities for special signs, such as the less-than (<)
sign, which needs to be replaced with &lt
;. Please see XML resources on-line for a list of common XML entities.
Note that the advanced chain definition editor does not allow you to edit the XML of the chain definition.
Procedure
To create a process definition:
- Choose "Definitions > Processes".
- Choose New Process Definition from the context-menu.
- Select the appropriate definition type.
- Fill in the values.
- Choose Save and Close.
note
Some tabs require a new element to be created, this is done either by choosing Add or choosing an empty row.
See Also
- Creating a Process Definition - video
- The Definition Types
- Chains
- Default System Process Definitions
- Default SAP Process Definitions
JobDefinition ProcessDefinition