Move an activity
/rest/ofscCore/v1/activities/{activityId}/custom-actions/move
This operation moves the activity according to specified parameters.
- If the value of the setDate parameter is specified, then the activity is moved to the specified date.
- If the value of the setResource parameter is specified, then the activity is reassigned to another resource.
- If the value of the setPositionInRoute parameter is specified, then the order of the activity is changed.
These parameters can be combined into a single request when the actions have to be performed simultaneously. At least one of these parameters must be specified.
The operation fails in the following environments:
- The destination resource is a field resource and the specified date is not a working day for the resource.
- The destination resource is a field resource and does not have a user account assigned.
- The destination resource is inactive.
- The destination date is greater than the value configured in the 'Future days limit' setting. The default value of the 'Future days limit' setting is 1098.
- The destination date is in the past.
- The destination resource does not exist or it cannot be assigned to activities.
- The operation is disabled for the specified activity type.
- The values specified in the request parameters are invalid.
Request
-
activityId(required): integer
The unique identifier of the activity in Oracle Field Service.
object
Custom Action Activity Move Schema
-
moveMultidayActivitySegments:
string
Title:
moveMultidayActivitySegments
Allowed Values:[ "onlyThisSegment", "allSegmentsInRoute", "allFollowingSegments" ]
The parameter is used to specify how a segmentable activity should be moved to another date:
- onlyThisSegment(default): Move only this activity segment.
- allSegmentsInRoute. Move all segments of this segmentable activity that are present in the same route (resource and date).
- allFollowingSegments. Move this segment and all segments of this segmentable activity that follow it.
This parameter is optional. It may be set only for multi-day activity segments. If it is not set, the default value is 'onlyThisSegment'.
-
protectTimeDelivered:
boolean
Title:
Protect Time Delivered
Contains one of the following values: true or false. If true, then the operation fails with the HTTP status '409 Conflict' error in case if move result causes Communicated Window violation of any activity in the route. If false, then any Communicated Window violation is ignored. -
setDate:
object Set Date
Title:
Set Date
The activity is scheduled to the date specified in the 'date' parameter only if this object is available. -
setPositionInRoute:
object Set Position in Route
Title:
Set Position in Route
The value of this element determines the position of the activity in the route. If this element is present then activity will be put to specified position in route. The parameter is optional, if it is absent then the value "position: byServiceWindow" is used. -
setResource:
object Set Resource
Title:
Set Resource
The activity is reassigned to the specified resource only if this object is available.
object
Set Date
-
date:
string
Title:
Date
The activity is rescheduled to the specified date. Specify either the date in the 'YYYY-MM-DD' format or specify NULL.If NULL is specified and the setDate object is available, then the activity is considered as non-scheduled.
object
Set Position in Route
-
activityId:
integer
Title:
Activity ID
The unique identifier of some pending ordered activity in the target route. It is used along with the 'afterActivity' value of the 'position' parameter so that to put one activity in the position after another. -
position(required):
string
Title:
Position
Allowed Values:[ "first", "last", "notOrdered", "byServiceWindow", "afterActivity" ]
The position of the activity in the route.
object
Set Resource
-
resourceId:
string
Title:
Resource ID
The unique identifier of the resource in Oracle Field Service.
Response
- application/json
- application/schema+json
204 Response
Default Response
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to move an activity by submitting a POST request on the REST resource using cURL.
curl -X 'POST' \ -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' \ -H 'Content-Type: application/json' \ --data-binary '{ "setDate": { "date": null } }' \ 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/activities/4225269/custom-actions/move'
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 204 No Content Server: nginx/1.2.7 Date: Fri, 18 Mar 2016 02:26:50 GMT Content-Type: application/json; charset=utf-8 Connection: close