REST interface for BPD-related resources - Activity Instance (available actions) Resource - GET Method

Use this method to retrieve the available actions for the activity instance and the current user.

Sample method invocation

GET /rest/bpm/wle/v1/activity/{activityInstanceId}/availableActions

Parameters

None

Request content

None

Response content

A list of available actions (AvailableActions complexType). Valid actions are ACTION_VIEW_ACTIVITY, ACTION_START_ACTIVITY, ACTION_DISABLE_ACTIVITY, ACTION_ENABLE_ACTIVITY.

The default content type is application/json.

MIME type: application/json


Schema
{  "description": "WLE Activity Instance Actions", 
   "type": "object",
   "properties":
   {  "identifier": {"type": "string"},
      "tasks": 
      [  
         {  "actions": {"type": ["string"],
               "description": "List of available actions for the activity instance.",
               "enum":
               [  
                  "ACTION_VIEW_ACTIVITY", 
                  "ACTION_START_ACTIVITY", 
                  "ACTION_DISABLE_ACTIVITY",
                  "ACTION_ENABLE_ACTIVITY"
               ]
            }
         }
      ]
   }   
}
Example content
{
   "status": "200",
   "data": {"actions":    [
      "ACTION_VIEW_ACTIVITY",
      "ACTION_START_ACTIVITY"
   ]}
}

MIME type: application/xml


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

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    <import schemaLocation="Common.xsd" namespace="http://rest.bpm.ibm.com/v1/data/common"/>
    <import schemaLocation="Task.xsd" namespace="http://rest.bpm.ibm.com/v1/data/task"/>


    <!--
        This type contains details related to a activity instance.
    -->
    <complexType name="Activity">
        <complexContent>
            <extension base="pref:Data">
                <sequence>

                    <!-- The activity instance ID -->
                    <element name="id" type="string" />

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

                    <!-- The current status of the activity instance 
                         Valid values are:
                          "READY",
                          "WORKING",
                          "WAITING",
                          "DISABLED",
                          "LAUNCHING",
                          "SKIPPED",
                          "COMPLETED",
                          "FAILED",
                          "NOT_USED" -->
                    <element name="executionState" type="string" />

                    <!-- The task type of the activity instance 
                         Valid values are:
                          "USER_TASK",
                          "CALLED_PROCESS",
                          "SUB_PROCESS" -->
                    <element name="activityType" type="string" />

                    <!-- The execution type of the activity instance 
                         Valid values are:
                          "AUTOMATIC",
                          "MANUAL",
                          "NONE" -->
                    <element name="executionType" type="string" />

                    <!-- The option type of the activity instance 
                         Valid values are:
                          "REQUIRED",
                          "OPTIONAL" -->
                    <element name="optionType" type="string" />

                    <!-- Indicates if the activity is required for completion. -->
                    <element name="required" type="boolean" />

                    <!-- Indicates if the activity is repeatable. -->
                    <element name="repeatable" type="boolean" />

                    <!-- The timestamp when the activity instance was started. -->
                    <element name="startTime" type="dateTime" nillable="true" />
                    
                    <!-- The timestamp when the activity instance reached an end state. -->
                    <element name="endTime" type="dateTime" nillable="true" />

                    <!-- Indicates if the activity is hidden. -->
                    <element name="hidden" type="boolean" />
                    
                    <!-- The ID of the document that enabled this activity, if any. -->
                    <element name="enablingDocumentID" type="string" nillable="true" />
                    
                    <!-- The server name of the document that enabled this activity, if any. -->
                    <element name="enablingDocumentServerName" type="string" nillable="true" />
                    
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!--
        This type contains details related to a activity instance.
    -->
    <complexType name="ActivityDetails">
        <complexContent>
            <extension base="tns:Activity">
                <sequence>

                    <!-- The due date associated with the activity -->
                    <element name="dueDate" type="dateTime" nillable="true" />
                    
                    <!-- The id of the related task (only with user task implementation) -->
                    <element name="taskId" type="string" nillable="true" />
                    
                    <!-- The owner's user id of the related task (only with user task implementation) -->
                    <element name="taskOwnerUserId" type="string" nillable="true" />
                    
                    <!-- The owner's group id of the related task (only with user task implementation) -->
                    <element name="taskOwnerGroupId" type="string" nillable="true" />

                    <!-- The narrative of the activity -->
                    <element name="narrative" type="string" nillable="true" />
                    
                    <!-- The type of the precondition -->
                    <element name="preconditionType" type="string" nillable="true" />
                    
                    <!-- The precondition triggers -->
                    <element name="preconditionTriggers" type="tns:PreconditionTriggers" nillable="true" />
                    
                    <!-- The precondition expressions -->
                    <element name="preconditionExpressions" type="tns:PreconditionExpressions" nillable="true" />
                    
                    <!-- The precondition expressions display -->
                    <element name="preconditionExpressionsDisplay" type="tns:PreconditionExpressionsDisplay" nillable="true" />

                    <!-- The precondition expressions display -->
                    <element name="preconditionIsMatchAll" type="boolean" nillable="true" />                    
                    
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!-- A list of action names. -->
    <complexType name="AvailableActions">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="actions" type="string" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    
    <!-- A list of current tasks. -->
    <complexType name="CurrentTasks">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="tasks" type="task:TaskDetails" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    
    <!-- A list of precondition triggers. -->
    <complexType name="PreconditionTriggers">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="triggers" type="string" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    
        <!-- A list of precondition expressions. -->
    <complexType name="PreconditionExpressions">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="expressions" type="string" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    
        <!-- A list of action names. -->
    <complexType name="PreconditionExpressionsDisplay">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="expressionsDisplay" type="string" 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>200</status>
    <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns8="http://rest.bpm.ibm.com/v1/data/activity" xsi:type="ns8:AvailableActions">
        <actions>ACTION_VIEW_ACTIVITY</actions>
        <actions>ACTION_START_ACTIVITY</actions>
    </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
200 OKSuccess completion.
404 Not Found
The activity instance does not exist.
406 Not AcceptableThe requested content type or content encoding is not supported.
500 Internal Server ErrorA severe problem has occurred, programmer's details are provided.

Available since

8.5.5

Parent Topic: Activity Instance (available actions) Resource