Module: UU::OS::Activity

Extended by:
Activity
Included in:
Activity
Defined in:
uu_os-0.29.16/lib/uu/os/activity.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_type.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_create.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_set_state.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_attributes.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_state_type.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_state_subtype.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_state_attributes.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_get_instance_list.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_get_activity_list.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_set_executive_role.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_set_competent_role.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_get_state_history_list.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_get_state_template_list.rb,
uu_os-0.29.16/lib/uu/os/activity/activity_state_template_attributes.rb

Overview

Module Activity.

Defined Under Namespace

Classes: ActivityAttributes, ActivityCreate, ActivityGetActivityList, ActivityGetInstanceList, ActivityGetStateHistoryList, ActivityGetStateTemplateList, ActivitySetAttributes, ActivitySetCompetentRole, ActivitySetExecutiveRole, ActivitySetState, ActivityStateAttributes, ActivityStateSubtype, ActivityStateTemplateAttributes, ActivityStateType, ActivityType

Constant Summary

PATH =

Service path

'ues/core/workflow/UESActivity'

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) create(parent_node_uri, activity = nil)

This command creates a new activity on the specified artifact. At the very least activity template or the activity type have to be specified in this command. Attention: No activity actions or conditions are copied from the template when the new activity is created by templateUri.

Examples:

# Create activity of type reservation.
activityCreate= UU::OS::Activity::ActivityCreate.new({
activity_type: UU::OS::Activity::ActivityType::TIME_RESERVATION,
allow_executive_role_change:true,
allow_subactivities:true,
block_time_in_calendar:false,
code:"ACTIVITYCREATETASK",
competent_role_uri:"ues:UNI:UNI~DIR",
date_start:"2013-09-03",
date_to:"2015-09-04",
description:"Some test description",
executive_role_uris:["ues:UNI:US08"],
name:"Test activity",
notify:true,
related_artifact_uri:"ues:UNI:NEWS",
})

UU::OS::Activity.create('ues:UNI:NEWS',activityCreate)

# Create activity of type TASK
activityCreate= UU::OS::Activity::ActivityCreate.new({
activity_type: UU::OS::Activity::ActivityType::TASK,
allow_executive_role_change:true,
allow_subactivities:true,
code:"ACTIVITYCREATETASK",
competent_role_uri:"ues:UNI:UNI~DIR",
date_from:"2013-09-03",
description:"Some test description",
executive_role_uris:["ues:UNI:US08"],
name:"Test activity",
notify:true,
related_artifact_uri:"ues:UNI:NEWS",
})

UU::OS::Activity.create('ues:UNI:NEWS',activityCreate)

Parameters:

  • parent_node_uri (String, UU::OS::UESURI)

    UESURI of an artifact (or a parent activity) where the new activity is created

  • activity (ActivityCreate) (defaults to: nil)

    DTO containing attributes of a new activity

Options Hash (activity):

  • :template_uri (String, UU::OS::UESURI)

    UESURI of the activity template. The template determines the type of the new activity. When nil is set, the template is determined by the type attribute (which cannot be nil in that case).

  • :activity_type (UU::OS::Activity::ActivityType)

    Specifies the type of the new activity. When nil is set, the activity type is determined by the template (templateUri attribute, which cannot be nil in that case).

  • :name (String)

    Name of the new activity. When nil is set, the name is taken from the template tName. When the template does not define a tDescription, the create command fails.

  • :code (String)

    Code of the new activity. When nil is set, the code is generated automatically using the system sequence. The code must be unique in a given artifact, otherwise the create command fails.

  • :description (String)

    Description of the new activity. When nil is set, the description is taken from the template tDescription. When the template does not define a tDescription, it is left empty.

  • :date_from (Object)

    Specifies the date when the activity is shown in the related users digital workspace. When nil is set, the actual date (00:00) is used for all types of activities except of an activity of type RESERVE_TIME or COVER_MEETING. In that case, parent’s dateFrom is used. If it is nil, the actual time is used (but if the actual time is later than dateStart of the activity, dateStart is set as dateFrom instead).
    Subactivity specifics: Always the dateFrom of the parent is used.

  • :date_start (Object)

    Specifies the start of the meeting. Cannot be nil for an activity of type RESERVE_TIME or COVER_MEETING, has to be nil for all other types of activities. Date must be in iso8601 format.

  • :date_to (Object)

    Specifies the date when the activity should be finished. When nil is set, the date is determined by the template settings. Cannot be nil for an activity of type RESERVE_TIME or COVER_MEETING.
    Subactivity specifics: The date must greater than parent’s dateFrom and lesser or equal as parent’s dateTo. When it is not possible to resolve dateFrom of parent activity, dateTo must be nil. Date must be in iso8601 format.

  • :date_expiration (Object)

    Specifies the date when the activity is automatically finished. This parameter is an object and it can contain three possible types of values: If it’s a Date, it sets the activity to expire at that date. Such a date has to be after the dateTo attribute. If it’s set to false, the activity will never expire (expiration is forbidden). If it’s nil, then the date is determined by the template settings.
    Subactivity specifics: The date has to be less or equal to parent’s dateExpiration. When it is not possible to resolve dateFrom of parent activity, dateExpiration must be nil. Date must be in iso8601 format.

  • :competent_role_uri (String, UU::OS::UESURI)

    The competent role for the activity. When nil is set, the result of authorization is used.
    Subactivity specifics: Nil must be set at creation subactivity (the competent role is taken from parent activity).

  • :executive_role_uris (Array)

    The executive role or roles of the new activity. Role or group role could be used. When more than one role is specified or when a group role is used, the command creates a delegation for every role.
    When nil is set, the same role as for competentRoleUri is used.
    Subactivity specifics: When nil is set at creation subactivity, the command fails.

  • :related_artifact_uri (String, UU::OS::UESURI)

    Deprecated since UES7-08 use attribute related_object_uri. Related artifact of the new activity. When nil is set, the related artifact is taken from the template. When the template does not define it, it is left empty.

  • :related_object_uri (String, UU::OS::UESURI)

    Related object of the new activity. When nil is set, the related object is taken from the template. When the template does not define it, it is left empty.

  • :allow_executive_role_change (Boolean)

    Specifies if it will be possible to change an executive role of the new activity in the future. When nil is set, is taken from the template. Cannot be false for an activity of type RESERVE_TIME or COVER_MEETING.

  • :allow_subactivities (Boolean)

    Specifies if it will be possible to create new child activities on the new activity in the future. When nil is set, is taken from the template. Cannot be false for an activity of type RESERVE_TIME or COVER_MEETING.

  • :block_time_in_calendar (Boolean)

    Specifies if the calendar should block the time for the time of meeting. Only for an activity of type RESERVE_TIME or COVER_MEETING. When nil is set, is taken from the template. See ActivityType.

  • :is_competent_role_participating (Boolean)

    Specifies if the root activity should be created as a cover activity, in case child activites are created. When nil is set, it is true. Only for an activity of type RESERVE_TIME or COVER_MEETING. See ActivityType.

  • :notify (Boolean)

    Specifies whether users who are cast in executiveRoleUris will be notified of the new activity in their Digital Workspace and by e-mail (if they have enabled e-mail notifications in their personal settings). If nil is set, notifications will be enabled so the users will be notified.

  • :parameters (String)

    Parameters for a macro or other processing tool. Value is a UTF-8 string with the maximum size of 4000 bytes.

Returns:



174
175
176
177
178
179
180
181
182
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 174

def create(parent_node_uri, activity = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  payload = UU::OS::Activity::ActivityCreate.new(activity).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('create', parent_node_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end

- (Object) delete(activity_uri)

This command deletes an unfinished activity. Planned activity will be removed from the system, activity in progress will be set to the canceled state.

Examples:

# Command that deletes activity
UU::OS::Activity.delete('ues:TERRITORY:ART:ACTIVITY')

Parameters:

  • activity_uri (String, UU::OS::UESURI)

    UESURI of the activity which is about to be deleted.



239
240
241
242
243
244
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 239

def delete(activity_uri)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('delete', activity_uri)
  end
end

- (UU::OS::REST::ResultList<Activity::ActivityGetActivityList, Activity::ActivityAttributes>) get_activity_list(parent_node_uri, criteria = nil)

Returns list of the activities and sub activities for the specified artifact or activity. Returned list does not contain any objects filtered out by executed UESQuery.

Examples:

# Command with recursive listing.
UU::OS::Activity.get_activity_list('ues:TER:ART:ACT', :query=>'ORDER BY name DESC', :recursive=>true) 

Parameters:

  • parent_node_uri (String, UU::OS::UESURI)

    UES URI of the artifact or activity for which activities are about to be listed.

  • criteria (ActivityGetActivityList) (defaults to: nil)

    DTO containing the criteria for filtering of the result list. Criteria are defined using UESQuery. Allowed filtering parameters are name, code, activityType, allowExecutiveRoleChange, allowSubactivities, blockTimeInCalendar, activityStateType, activityStateSubtype, recurrent, termModifiable, dateFrom, dateStart, dateTo and dateFinished.

Options Hash (criteria):

  • :query (String)

    The UES query string. It has to conform the ues query syntax (see documentation for more info). Filtering and order of the result list can be specified there. When nil is set, no filtering is applied and entries are ordered by name and code as the second criteria.

  • :recursive (Boolean)

    Flag for recursive listing. It means that if the listed activities contains sub activities and the recursive flag is true, all sub activities are in result too. When the recursive flag is nil or false, only entries are returned exactly from the listed artifact without sub activities.

Returns:



284
285
286
287
288
289
290
291
292
293
294
295
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 284

def get_activity_list(parent_node_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  dto = Activity::ActivityGetActivityList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  svc.add_parameter('recursive', dto.recursive)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getActivityList', parent_node_uri)
    return UU::OS::REST::ResultList.new(Activity::ActivityGetActivityList, Activity::ActivityAttributes, res)
  end
end

- (ActivityAttributes) get_attributes(activity_uri)

This command returns attributes representing the activity specified by the activityUri parameter. The command does not change the state of the activity in the system.

Examples:

# Get activity attributes.
UU::OS::Activity.get_attributes('ues:TERRITORY:ARTIFACT:ACTIVITY')

# Get activity attributes with main entity normalized uri.
UU::OS::Activity.get_attributes('ues:TERRITORY[412357]:NEWS[417204]:ACTIVITYATRIBUTES[57420895257493462]')

Parameters:

  • activity_uri (String, UU::OS::UESURI)

    UESURI of an activity whose attributes are returned

Returns:



101
102
103
104
105
106
107
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 101

def get_attributes(activity_uri)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAttributes', activity_uri)
    return Activity::ActivityAttributes.new(res)
  end
end

- (UU::OS::REST::ResultList<Activity::ActivityGetInstanceList, Activity::ActivityAttributes>) get_instance_list(activity_uri, criteria = nil)

Returns list of all instances of the recurrent activity. Returned list does not contain any objects filtered out by executed UESQuery.

Examples:

# Get activity instance list.
getInstanceList = UU::OS::Activity.get_instance_list('ues:TER:ART:ACT',:query=>'ORDER BY activityType,code')

Parameters:

  • activity_uri (String, UU::OS::UESURI)

    UESURI of the activity for which instances are to be listed.

  • criteria (defaults to: nil)

    DTO containing the criteria for filtering of the result list. Criteria are defined using UESQuery. Allowed filtering parameters are name, code, activityType, allowExecutiveRoleChange, allowSubactivities, blockTimeInCalendar, activityStateType, activityStateSubtype, recurrent, termModifiable, dateFrom, dateStart, dateTo and dateFinished.

Options Hash (criteria):

  • :query (String)

    The UES query string. It has to conform the ues query syntax (see documentation for more info). Filtering and order of the result list can be specified there. When nil is set, no filtering is applied and entries are ordered by name and code as the second criteria.

Returns:



257
258
259
260
261
262
263
264
265
266
267
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 257

def get_instance_list(activity_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  dto = Activity::ActivityGetInstanceList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getInstanceList', activity_uri)
    return UU::OS::REST::ResultList.new(Activity::ActivityGetInstanceList, Activity::ActivityAttributes, res)
  end
end

- (UU::OS::REST::ResultList<Activity::ActivityGetStateHistoryList, Activity::ActivityStateAttributes>) get_state_history_list(activity_uri, criteria = nil)

Retrieves the list of set states on a given activity based on provided criteria.

Examples:

# UESURI of the activity
activity_uri = 'ues:UNI-BT:44191582648611234:57420906578882155'

# Get all activity states that were set on the activity
list = UU::OS::Activity.get_state_history_list(activity_uri)

Parameters:

  • activity_uri (String, UU::OS::UESURI)

    UESURI of the activity (model or instance), whose communication will be retrieved.

  • criteria (ActivityGetStateHistoryList) (defaults to: nil)

    Object containing paging criteria.

Returns:



311
312
313
314
315
316
317
318
319
320
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 311

def get_state_history_list(activity_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  dto = Activity::ActivityGetStateHistoryList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getStateHistoryList', activity_uri)
    return UU::OS::REST::ResultList.new(Activity::ActivityGetStateHistoryList, Activity::ActivityStateAttributes, res)
  end
end

- (UU::OS::REST::ResultList<Activity::ActivityGetStateTemplateList, Activity::ActivityStateTemplateAttributes>) get_state_template_list(activity_uri, criteria = nil)

Returns a list of activity state templates which can be set by the current user for the specified activity.

Examples:

# Returns a list of activity state templates which can be set by the current user for the specified activity which have the initial type
UU::OS::Activity.get_state_template_list('ues:TERRITORY:ARTIFACT:ACTIVITY', :query => 'type=INITIAL')

Parameters:

  • activity_uri (String, UU::OS::UESURI)

    UESURI of the activity whose state templates will be returned for the current user.

  • criteria (ActivityGetStateHistoryList) (defaults to: nil)

    The search criteria.

Options Hash (criteria):

  • :query (String)

    The query for filtering and ordering of the result list. It must conform the uesQuery syntax (see the documentation for more info). The result list can be filtered and ordered by the following attributes: name, code, type, entryState, exitState, order. If set to nil, no filtering will be applied and entries will be ordered by order and name.

Returns:



333
334
335
336
337
338
339
340
341
342
343
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 333

def get_state_template_list(activity_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  dto = Activity::ActivityGetStateTemplateList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getStateTemplateList', activity_uri)
    return UU::OS::REST::ResultList.new(Activity::ActivityGetStateTemplateList, Activity::ActivityStateTemplateAttributes, res)
  end
end

- (UU::OS::UESURI) set_attributes(activity_uri, activity = nil)

This command updates some basic attributes of an activity.

Examples:

# Set activity new expiration
activitySetAttributes= UU::OS::Activity::ActivitySetAttributes.new({
allow_executive_role_change:true,
allow_subactivities:true, 
date_expiration:"2013-10-03",     
description:"Some test description",
executiveRoleUri:"ues:UNI:US08",
name:"New name",  
})

activityUri = UU::OS::Activity.set_attributes('ues:UNI:ART:ACTIVITY',activitySetAttributes)

Parameters:

  • activity_uri (String, UU::OS::UESURI)

    UESURI of the activity whose attributes are to be changed

  • activity (ActivitySetAttributes) (defaults to: nil)

    DTO containing new attributes the activity

Options Hash (activity):

  • :name (String)

    The new name of the activity. If it is not specified, the value is not modified.

  • :code (String)

    The new code of the activity. If it is not specified, the value is not modified. The code must be unique in a given artifact, otherwise the setAttributes command fails.

  • :description (String)

    The new description of the activity. If it is not specified, the value is not modified.

  • :date_from (Object)

    Specifies the date when the activity is shown in the related users digital workspace. Date must be in iso8601 format.

  • :date_start (Object)

    The new start of the meeting. Could be specified only for activities of type TIME_RESERVATION or COVER_MEETING. If it is not specified, the value is not modified.
    Subactivity specifics: Always the date must be nil. See ActivityType. Date must be in iso8601 format.

  • :date_to (Object)

    The new date when the activity should be finished. If it is not specified, the value is not modified. Date must be in iso8601 format.

  • :date_expiration (Object)

    Specifies the date when the activity is automatically finished. This parameter is an object and it can contain three possible types of values: If it’s a Date, it sets the activity to expire at that date. Such a date has to be after the dateTo attribute. If it’s set to false, the activity will never expire (expiration is forbidden). If it is not specified, the value is not modified. Subactivity specifics: The date has to be less or equal to parent’s dateExpiration. When it is not possible to resolve dateFrom of parent activity, dateExpiration must be nil. Date must be in iso8601 format. If it is not specified, the value is not modified.

  • :related_artifact_uri (String, UU::OS::UESURI)

    The new related artifact of the activity. If it is not specified, the related artifact reference is not modified. If nil UESURI (“ues:[-1]:[-1]:”) is set, the related artifact is set empty. Subactivity specifics: The date must greater than parent’s dateFrom and lesser or equal as parent’s dateTo. When it is not possible to resolve dateFrom of parent activity, dateTo must be nil.

  • :related_object_uri (String, UU::OS::UESURI)

    The new related object of the activity. If it is not specified, the related object reference is not modified. If nil UESURI (“ues:[-1]:[-1]:”) is set, the related artifact is set empty.

  • :allow_executive_role_change (Boolean)

    Specifies if it will be possible to change an executive role of the activity in the future. If it is not specified, the value is not modified.

  • :allow_subactivities (Boolean)

    Specifies if it will be possible to create new child activities on the activity in the future. If it is not specified, the value is not modified.

  • :block_time_in_calendar (Boolean)

    Specifies if the calendar should block the time for the time of meeting. Only for activities type TIME_RESERVATION or COVER_MEETING. If it is not specified, the value is not modified. See ActivityType.

  • :competent_role_uri (String, UU::OS::UESURI)

    Deprecated. The new competent role for the activity. If it is not specified, the value is not modified.

  • :executive_role_uri (String, UU::OS::UESURI)

    Deprecated. The new executive role of the activity. If it is not specified, the value is not modified.
    Subactivity specifics: nil must be set at creation subactivity (the competent role is taken from parent activity).

  • :notify (Boolean)

    Specifies whether users who are cast in executiveRoleUri will be notified of the modified activity in their Digital Workspace and by e-mail (if they have enabled e-mail notifications in their personal settings). If nil is set, notifications will be enabled so the users will be notified.

  • :parameters (String)

    Parameters for a macro or other processing tool. Value is a UTF-8 string with the maximum size of 4000 bytes. If it is not specified, the value is not modified.

Returns:

  • (UU::OS::UESURI)

    UESURI of the activity. It could be changed because command could change name and code.



220
221
222
223
224
225
226
227
228
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 220

def set_attributes(activity_uri, activity = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  payload = UU::OS::Activity::ActivitySetAttributes.new(activity).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', activity_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end

- (Object) set_competent_role(activity_uri, activity = nil)

This command sets new competent role for the specified activity.

Examples:

# Set competent role.
UU::OS::Activity.set_competent_role('ues:TERRITORY:ARTIFACT:ACTIVITY', :competent_role_uri => 'ues:UNI:UNI')

Parameters:

Options Hash (activity):

  • :competent_role_uri (String, UU::OS::UESURI)

    URI of new competent role.



60
61
62
63
64
65
66
67
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 60

def set_competent_role(activity_uri, activity = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  payload = UU::OS::Activity::ActivitySetCompetentRole.new(activity).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('setCompetentRole', activity_uri, payload)
  end
end

- (Object) set_executive_role(activity_uri, activity = nil)

This command sets new executive role for the specified activity.

Examples:

# Set executive role.
UU::OS::Activity.set_executive_role('ues:TERRITORY:ARTIFACT:ACTIVITY', :executive_role_uri => 'ues:UNI:UNI')

Parameters:

Options Hash (activity):

  • :executive_role_uri (String, UU::OS::UESURI)

    URI of new executive role.



78
79
80
81
82
83
84
85
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 78

def set_executive_role(activity_uri, activity = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  payload = UU::OS::Activity::ActivitySetExecutiveRole.new(activity).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('setExecutiveRole', activity_uri, payload)
  end
end

- (Object) set_state(activity_uri, activity = nil)

This command sets a new state for the specified activity. You can enter the state template using ues uri or by specifying its type and, additionally, subtype.

Examples:

# Set activity state by type and subtype.
UU::OS::Activity.set_state('ues:TERRITORY:ARTIFACT:ACTIVITY', :type => 'ACTIVE', :subtype => 'II')

# Set activity state by ues uri of state template.
UU::OS::Activity.set_state('ues:TERRITORY:ARTIFACT:ACTIVITY', :template_uri => 'ues:TERRITORY:META_ARTIFACT:ACTIVITY_TEMPLATE')

Parameters:

Options Hash (activity):

  • :template_uri (String, UU::OS::UESURI)

    When nil is set, attribute type (and subtype) will be used to setting activity state.

  • :type (String)

    When nil is set, attribute templateUri must be set.

  • :subtype (String)

    When nil is set, the first possible subtype will be used.

  • :comment (String)

    Activity state’s comment. When nil is set, comment will be left empty.



42
43
44
45
46
47
48
49
# File 'uu_os-0.29.16/lib/uu/os/activity.rb', line 42

def set_state(activity_uri, activity = nil)
  svc = UU::OS::REST::RemoteClient.new(Activity)
  payload = UU::OS::Activity::ActivitySetState.new(activity).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('setState', activity_uri, payload)
  end
end