Creating a Link Type between Process Instances

Infinity provides the predefined link types Switch, Join, Upgrade and Spawn. If you like to link two process instances by using a more general link, you can use the following method of the AdministrationService:

/**
 * Creates a new type of link between process instances.
 *
 * @param id the id of the link type.
 * @param description the description of the link type.
 *
 * @return the newly created process instance link type.
 *
 * @throws ObjectExistsException if another link type with the same id already exists.
 */
@ExecutionPermission(id=ExecutionPermission.Id.modifyAuditTrail)
public ProcessInstanceLinkType createProcessInstanceLinkType(String id, String description);

Querying for Link Types

To query for link types, you can use the Infinity QueryService.

Querying for a specific Link Type

Method getProcessInstanceLinkType(String id) gets a specific process instance link type, defined by its Id.

/**
 * Gets a specific process instance link type.
 *
 * @param id the in of the process instance link type.
 * @return the process instance link type.
 *
 * @throws ObjectNotFoundException if there is no process instance link type with the specified id.
 */
@ExecutionPermission
public ProcessInstanceLinkType getProcessInstanceLinkType(String id);

Querying for all defined Link Types

To retrieve all defined process instance link types, use method getAllProcessInstanceLinkTypes().

/**
 * Gets all process instance link types defined.
 *
 * @return a list of process instance link types.
 */
@ExecutionPermission
public List<ProcessInstanceLinkType> getAllProcessInstanceLinkTypes();