Move an activity

post

/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

Path Parameters
Body ()
Root Schema : Custom Action Activity Move Schema
Type: object
Title: Custom Action Activity Move Schema
The schema of the request body object for this operation.
Show Source
  • 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'.

  • 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.
  • Set Date
    Title: Set Date
    The activity is scheduled to the date specified in the 'date' parameter only if this object is available.
  • 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.
  • Set Resource
    Title: Set Resource
    The activity is reassigned to the specified resource only if this object is available.
Nested Schema : Set Date
Type: object
Title: Set Date
The activity is scheduled to the date specified in the 'date' parameter only if this object is available.
Show Source
  • 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.

Nested Schema : Set Position in Route
Type: object
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.
Show Source
  • 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.
  • Title: Position
    Allowed Values: [ "first", "last", "notOrdered", "byServiceWindow", "afterActivity" ]
    The position of the activity in the route.
Nested Schema : Set Resource
Type: object
Title: Set Resource
The activity is reassigned to the specified resource only if this object is available.
Show Source
  • Title: Resource ID
    The unique identifier of the resource in Oracle Field Service.
Back to Top

Response

Supported Media Types

204 Response

This section describes the 204 status response for this operation. This response code indicates that the operation completed successfully.

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

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
Back to Top