MODIFY_UC_OBJECT
Use the MODIFY_UC_OBJECT script function to modify specific attributes of an activated object. If you assign new values to these attributes, these values are only valid for the current execution of the task and they are not stored in the object.
Syntax
MODIFY_UC_OBJECT (RunID, Attribute, Value)
Parameters
- MODIFY_UC_OBJECT
Modifies the attribute of an activated object - RunID
Run number of the activated object
Format: script literal, number or script variable
Note: If you use the EARLIEST_STARTTIME attribute, you must specify the RunID of the workflow to which the task belongs and not the RunID of the task. - Attribute
Attribute that should be modified. See below for the list of available attributes.
Format: AE name or script variable - Value
Value that should be set for the attribute that you want to change
Format: AE name, script literal, number or script variable
Attributes
Depending on the object type, you can modify the values of various attributes:
- CALL
Attribute: RESPONSE
Reacts to a notification
Values:- OK
Acknowledges a Notification (message) - YES
Responds to a Notification (request) - NO
Responds to a Notification (request) - ACCEPT
Accepts a Notification (alert) - REJECT
Rejects a Notification (alert) - DONE
Resolves a Notification (alert)
Return codes:
- 20539
The notification with the indicated RUN# does not exist. - 20538
The value is incorrect. - 11151
The value for the attribute RESPONSE does not apply for the notification type (alert, request, message). - 11060
The combination notification and value is not supported. - 11061
The notification was already acknowledged by a different user. - 11062
The notification was acknowledged by a user who is not available in the notification. - 1064
The notification was rejected by a user who is not available in the notification. - 20859
The reaction to the notification was made be a user who is available in the notification but is inactive.
- OK
- JOBG
Attribute: GR_MAX_PAR_JOBS
Defines the maximum number of parallel running tasks in a group
Value: 1-999
Return codes:- 11121
The RUN# was not found. - 20460
The value does not lie between 1 and 999.
- 11121
- JOBP
Attributes:- RELEASE
Releases a blocked workflow
Value: RUN# of the blocked task in the workflow
Return codes:- 11016
The workflow to be changed does not exist - 11510
The workflow is not active - 20540
The RUN# was not found
- 11016
- RELEASE
- GOIMM
Starts a workflow task immediately
Value: The name of the task that must only be used once in the workflow. -
EARLIEST_STARTTIME
Modifies the earliest start time of a task in a workflow. The start time is assigned to the task or replaces an already existing one.
Values: Either the earliest start time in the format HHMMSS if no particular format is defined, or the keyword OFF which removes an existing start time. In both cases, the script function requires the task name:
Syntax:
Task name, [Time format;]Time or
Task name, OFF - REMOVE_DEPENDENCY
Removes the dependency to the direct predecessor of the task. The task ignores the expected end status that is set in the Time & Dependencies properties page of the specified predecessor. As a result, the task continues when it reaches this task if all other predecessors have already ended. I no particular predecessor is indicated, all predecessors are ignored and the task starts immediately. For more information, seeTime & Dependencies.
Syntax:
Task name [, Predecessor's name ] - 11557
The Job '&01' (RunID: '&02') has already been started through the Go Immediately option. - 20378
The workflow could not be found. - 20840
The task appears in the workflow more than once. - 20841
The indicated task does not exist in the workflow.
For the following three workflow attributes, the task that should be changed must be in a Waiting for precondition status:
Return codes:
- CALL, JOBF, JOBP, JOBS, JSCH, SCRI
Attribute: PRIORITY
Task priority
Value: 0-255
Return codes:- 20591
The RUN# was not found - 20587
The value does not lie between 0 and 255
- 20591
- Workflow tasks
Attributes:- IGNORE_CONDITIONS
Starts a workflow task that is in a Waiting for Preconditions status immediately.
Value: Not required.
For more information, see Conditions, Preconditions, Postconditions. - CHECK_CONDITIONS
Starts checking the conditions/actions of a workflow task that is in a Waiting for Preconditions status from the beginning.
Value: Not required
- IGNORE_CONDITIONS
- CALL, EVNT, JOBF, JOBG, JOBP, JOBQ,JOBS, JSCH, SCRI
Attribute: IGNORE_QUEUE
Starts a task that is in a waiting condition because of insufficient queue slots immediately
Value: Not required - JOBS, JOBF and JOBD
Attribute: SET_EXPRESS
Starts a task that is in a Waiting for resource status immediately
Values: ON or OFF - All executable objects
Attribute: IGNORE_SYNC
Sync object settings are ignored. This parameter must be specified but its value is irrelevant.
Example: MODIFY_UC_OBJECT( &RUNNR#, IGNORE_SYNC, "")
Return code:- 11191
The RUN# was not found
- 11191
- Recurring tasks
Attribute: GAP
Changes the time gap between the executions in a recurring task.
Value: Specified in minutes
Return codes:- 20534
Value "0" is not allowed - 20591
RUN# was not found. - 20860
This is not a recurring task - 20861
The option "With a gap of..." has not been selected in the recurring task.
- 20534
Notes:
- The task that you want to modify must already have been generated, but still be in a waiting condition. The task must be configured to be generated at activation, not at runtime. If you need to modify a task at its generation time, use :PUT_ATT instead.
- The script statement causes all open transactions of the script to be written to the AE database. For more information, see Script Processing.
General return codes
- 0
Attribute was successfully modified - 20342
This attribute is not supported
Examples
The first example shows how you can acknowledge a notification (request). The first step determines the RUN# and stores it to the script variable "&RUNNR#".
:SET &RUNNR# = ACTIVATE_UC_OBJECT("Nightshift")
!...
:SET &MODOBJ# = MODIFY_UC_OBJECT(&RUNNR#,
RESPONSE, OK)
The second example activates a group and stores the RUN# in a script variable. The number of parallel running tasks in the group is set to 1. Selected tasks can only be processed one by one.
:SET &RUNNR# = ACTIVATE_UC_OBJECT("GRP7")
:SET &MODOBJ# = MODIFY_UC_OBJECT( &RUNNR#,
GR_MAX_PAR_JOBS, 1)
The following examples show modifications that are made in tasks that run in a workflow:
!The job "MM.CLOSING" should start
immediately.
:SET &RUNNR# = GET_UC_OBJECT_NR(MM.DAY)
:SET &MODOBJ# = MODIFY_UC_OBJECT(&RUNNR#, GOIMM, "MM.CLOSING")
!The job "MM.CLOSING" should not
run earlier than 3pm.
:SET &RUNNR# = GET_UC_OBJECT_NR(MM.DAY)
:SET &MODOBJ# = MODIFY_UC_OBJECT(&RUNNR#, EARLIEST_STARTTIME,
"MM.CLOSING","150000")
!The job "MM.CLOSING" should ignore
the earliest start time.
:SET &RUNNR# = GET_UC_OBJECT_NR(MM.DAY)
:SET &MODOBJ# = MODIFY_UC_OBJECT(&RUNNR#, EARLIEST_STARTTIME,
"MM.CLOSING",
OFF)
!The job "MM.CLOSING" should ignore
the dependency to the predecessor "MM.DAY_END".
:SET &RUNNR# = GET_UC_OBJECT_NR(MAWI.TAG)
:SET &MODOBJ# = MODIFY_UC_OBJECT(&RUNNR#, REMOVE_DEPENDENCY,
"MM.CLOSING",
"MM.DAY_END")
Tip: Use the :ON_ERROR script statement to define the action that should be taken if the modification fails. For more information, see Script Elements for Error Handling.
See also: