REST interface for BPD-related resources - Process Instance Relationship Resource - POST Method

Creates a relationship between two process instances.

Sample method invocation

/rest/bpm/wle/v1/process/{instanceId}/relationship?type={string}&targetId={string}[&description={string}]

Parameters

Required parameters
NameValue TypeDescription
type string
The type of relationship to create.
ValueDescription
INDEPENDENT
An independent relationship.
DEPENDENT
A dependent relationship where the current instance becomes dependent on the instance that is passed as an argument. This relationship prevents completion of the current process instance until the instance that it depends on completes.
targetId string
The process instance identifier of the instance to which a relationship is added.
Optional parameters
NameValue TypeDescription
description string
A string that describes the relationship.

Request content

None

Response content

The created relationship details (RelationshipDetails complexType).

The default content type is application/json.

MIME type: application/json


Schema
{
   "description":"RelationshipDetails",
   "type":"object",
   "properties":{
      "id":{
         "type":"string",
         "description":"The Relationship identifier."
      },
      "sourceId":{
         "type":"string",
         "description":"The externalized form of the instance ID of the source, consisting of a type identifier and the instance ID."
      },
      "targetId":{
         "type":"string",
         "description":"The externalized form of the instance ID of the target, consisting of a type identifier and the instance ID."
      },
      "type":{
         "type":"string",
         "description":"The type of the relationship.",
         "enum":[
            "INDEPENDENT",
            "DEPENDENT"
         ]
      },
      "creator":{
         "type":"object",
         "description":"The user who created the relationship.",
         "properties":{
            "userID":{
               "type":"integer",
               "description":"The user ID of the user that is described by this object."
            },
            "userName":{
               "type":"string",
               "description":"The user name of the user that is described by this object."
            },
            "fullName":{
               "type":"string",
               "description":"The full name of the user that is described by this object."
            },
            "isDisabled":{
               "type":"boolean",
               "description":"States whether this user is disabled. This field is set to false and cannot be changed."
            },
            "primaryGroup":{
               "type":"string",
               "description":"The primary group associated with this user."
            },
            "emailAddress":{
               "type":"string",
               "description":"The email address associated with this user."
            },
            "userPreferences":[
               {
                  "key":{
                     "type":"string",
                     "description":"The key associated with the user preference."
                  },
                  "value":{
                     "type":"string",
                     "description":"They value associated with the user preference."
                  }
               }
            ],
            "memberships":{
               "type":"[string]",
               "description":"List of groups in which the user is a member."
            }
         }
      },
      "creationDate":{
         "type":"string",
         "format":"date-time",
         "description":"The date when the relationship was created."
      },
      "lastModified":{
         "type":"string",
         "format":"date-time",
         "description":"The date when the relationship was last modified."
      },
      "description":{
         "type":"string",
         "description":"The description of the relationship."
      }
   }
}
Example content
{
  "status": "201",
  "data": {
    "id": "2124.1a561d39-12aa-4df0-826c-e9a27f5de55f",
    "sourceId": "2072.3",
    "targetId": "2072.5",
    "type": "INDEPENDENT",
    "creator": {
      "userID": 1,
      "userName": "celladmin",
      "fullName": "celladmin",
      "isDisabled": false,
      "primaryGroup": null,
      "emailAddress": null,
      "userPreferences": {},
      "tasksCollaboration": null,
      "memberships": null
    },
    "creationDate": "2014-10-30T21:19:35Z",
    "lastModified": "2014-10-30T21:19:35Z",
    "description": "Some other description here"
  }
}

MIME type: application/xml


Schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/relationship"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema" 
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/relationship"
	xmlns:pref="http://rest.bpm.ibm.com/v1/data/root"
	xmlns:userg="http://rest.bpm.ibm.com/v1/data/usergroup">

	<import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root"/>
	<import schemaLocation="UserGroup.xsd" namespace="http://rest.bpm.ibm.com/v1/data/usergroup"/>

	<simpleType name="RelationshipType">
		<restriction base="NCName">
			<enumeration value="INDEPENDENT"/>
			<enumeration value="DEPENDENT"/>
		</restriction>
	</simpleType>

	<!-- This type represents a single relationship. -->
	<complexType name="RelationshipDetails">
		<annotation>
			<documentation>Describes a relationship between two instances.</documentation>
		</annotation>
		<complexContent>
			<extension base="pref:Data">
				<sequence>

					<!-- The ID of the relationship -->
                    <element name="id" type="string"/>

                    <!-- The externalized form of the instance ID of the source -->
                    <element name="sourceId" type="string"/>

                    <!-- The externalized form of the instance ID of the target -->
                    <element name="targetId" type="string"/>

                    <!-- The type of the relationship. 
                    		Valid values are:
                    			"INDEPENDENT"
                    			"DEPENDENT" -->
                    <element name="type" type="tns:RelationshipType"/>

                    <!-- The user who created the relationship -->
                    <element name="creator" type="userg:User"></element>

		            <!-- The date when the relationship was created -->
        		    <element name="creationDate" type="dateTime"/>

        		    <!-- The date when the relationship was last modified -->
        		    <element name="lastModified" type="dateTime"/>

        		    <!-- The description of the relationship -->
                    <element name="description" type="string"/>

				</sequence>
			</extension>
		</complexContent>
	</complexType>

	<!-- This type is used to return a list of relationship details. -->
	<complexType name="RelationshipDetailsList">
		<complexContent>
			<extension base="pref:Data">
				<sequence>
					<!-- This is a list of zero or more relationship details. -->
					<element name="relationship" type="tns:RelationshipDetails" minOccurs="0" maxOccurs="unbounded" />
				</sequence>
			</extension>
		</complexContent>
	</complexType>
</schema>
Example content
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bpm:ResponseData xmlns:bpm='http://rest.bpm.ibm.com/v1/data'>
    <status>201</status>
    <data xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:type='rel:RelationshipDetails' xmlns:rel='http://rest.bpm.ibm.com/v1/data/relationship'>
        <id>2124.4fb626e4-f558-433d-a263-e86b56c9c9d9</id>
        <sourceId>2072.3</sourceId>
        <targetId>2072.4</targetId>
        <type>INDEPENDENT</type>
        <creator>
            <userID>1</userID>
            <userName>celladmin</userName>
            <fullName>celladmin</fullName>
            <isDisabled>false</isDisabled>
            <userPreferences/>
        </creator>
        <creationDate>2014-10-30T21:15:35Z</creationDate>
        <lastModified>2014-10-30T21:15:35Z</lastModified>
        <description>Some description here</description>
    </data>
</bpm:ResponseData>

MIME type: application/x-javascript

Error Response content

Detailed error information.

The default content type is application/json.

MIME type: application/json


Schema
{  "description": "WLE Error Response", 
   "type": "object",
   "properties":
   {  "status": {"type": "string",
         "description": "The status of the previous API call."
      },
      "exceptionType": {"type": "string",
         "description": "The classname associated with the exception."
      },
      "errorNumber": {"type": "string",
         "description": "Message ID of the exception."
      },
      "errorMessage": {"type": "string",
         "description": "Message text of the exception."
      },
      "errorMessageParameters": {"type": ["string"], "optional": true,
         "description":"Message text parameters of the exception."
      },
      "programmersDetails": {"type": "object", "optional": true,
         "description":"Additional exception details, for example, a stack trace."
      }
   }
} 

MIME type: application/xml


Schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/exception"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/exception"
	xmlns:dat="http://rest.bpm.ibm.com/v1/data/root">

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    
    <!--
	This type represents an error response.
    -->    
    <element name="RestRuntimeException">
	<complexType>
	    <sequence>
		<element name="status" type="string"/>
		<element name="Data" type="tns:ExceptionData">
    		</element>
	    </sequence>
	</complexType>
    </element>

    <!-- 
	 This type contains detailed error information associated with an exception.
    -->
    <complexType name="ExceptionData">
	<sequence>
	    <element name="status" type="string"/>

	    <!-- This specifies the java class name of the exception -->
	    <element name="exceptionType" type="string"/>

	    <!-- The message ID of the error message -->
	    <element name="errorNumber" type="string" minOccurs="0"/>

	    <!-- The complete error message -->
	    <element name="errorMessage" type="string"/>

	    <!-- The list of strings inserted into the error message -->
	    <element name="errorMessageParameters" type="string" minOccurs="0" maxOccurs="unbounded"/>

	    <!-- 
		 The stacktrace associated with the exception.
		 Note that this will be omitted unless the "server-stacktrace-enabled" property
		 is enabled in the server's 100Custom.xml file.
	    -->     
	    <element name="programmersDetails" type="string"></element>
	    
	    <!-- Prior responses.  Set if a bulk command was used -->
	    <element name="responses" type="dat:BulkCommandResponses" minOccurs="0"></element>

            <element name="errorData" type="tns:ErrorData" minOccurs="0" />
	</sequence>
    </complexType>

    <complexType name="ErrorData">
        <sequence>
            <element name="code" type="string" />
            <element name="data" type="string" minOccurs="0" />
        </sequence>
    </complexType>
    
</schema>

MIME type: application/x-javascript

Status codes

The method returns one of the following status codes:
CodeDescription
201 Created
Successful completion, new relationship created.
400 Bad Request
Bad Request
401 Unauthorized
The caller is not authorized for this request.
403 Forbidden
The caller is not authorized to perform this operation.
406 Not AcceptableThe requested content type or content encoding is not supported.
500 Internal Server Error
Internal Server Error. See the details provided.

Available since

8.5.6.0

Parent Topic: Process Instance Relationship Resource