Defining a new process and associated route

The DKProcessICM class represents a process definition which contains a collection of interconnecting routes that describe the steps and flows of a process (in addition to other attributes such as time limit) and description of a process. The DKRouteListEntryICM class defines the route that a process can take (as in from or to).

A process object (DKProcessICM) contains a collection of route entry objects (DKRouteListEntryICM). Certain fields (decision rule and precedence) facilitate the construction of decision rules for routes that leave the decision nodes.

A document routing process is the defined routes that a work package being routed follows. Multiple routing processes can reuse the same nodes and you can also use multiple routes between nodes.

It is possible to create document routing process definitions with API directly. But you should avoid doing so if at all possible. Because creating document routing process with the APIs risks unexpected behavior (such as creating illegal parallel routing construct) and damage to the system, the graphical workflow builder averts this by validating a process before it is saved into the library server.
Tip: You can write a program that uses the APIs to retrieve and examine the value set by the graphical builder, but do not set those decision rules by yourself for risk of creating an invalid decision rule.

Example: Java™

// Create a new Process Definition
DKProcessICM process = new DKProcessICM();  
process.setName("S_claimProcess");
process.setDescription("Process for an Insurance Claim"); 

// Define all possible Routes. 

// Create a list of all possible routes between nodes.
dkCollection routes = new DKSequentialCollection();

// Connect the Work Nodes by using Route List Entries.  A simple route
//between two work nodes is specified by associating a 'From' work 
//node and a 'To' work node.
// A Route List Entry simply connects two nodes with an implied direction.
// Multiple routes might exist between nodes. A specific route might be selected
// by a user-defined "selection" keyword.Examples might be "Continue", "Go",
// "Accept", "Reject", "Complete", and so on.
// Create a new connection between two nodes.
DKRouteListEntryICM nodeRoute = new DKRouteListEntryICM();

// Every process must start with the start node.
nodeRoute.setFrom(DKConstantICM.DK_ICM_DR_START_NODE);
nodeRoute.setTo("S_fillClaim");
// Choose any user-defined name for an action that will make the 
//transition from the 1st node to the second
nodeRoute.setSelection("Continue");  

// Add the individual route to the collection of all possible routes.
routes.addElement(nodeRoute);
nodeRoute = new DKRouteListEntryICM(); 
nodeRoute.setFrom("S_fillClaim");  
nodeRoute.setTo("S_gatherAll");
// Choose any user-defined name for an action that will make the
// transition take place. 
nodeRoute.setSelection("Continue");

//Add the individual route to the collection of all possible routes. 
routes.addElement(nodeRoute);   
nodeRoute = new DKRouteListEntryICM(); 
nodeRoute.setFrom("S_gatherAll");
nodeRoute.setTo(DKConstantICM.DK_ICM_DR_END_NODE);

// Choose any user-defined name for an action that will make 
//the transition take place.
nodeRoute.setSelection("Complete");
//Add the individual route to the collection of all possible routes.
routes.addElement(nodeRoute);
// Set the route in the process.
process.setRoute(routes);
// Add the process to the routing Management.
routingMgmt.add(process);

For the complete example, see the SDocRoutingDefinitionCreationICM sample.