OScript API/Built-in Package Index

Class: WAPI

WAPI ( Workflow Application Programming Interface) maintains a database of Maps, and Work along with providing functions to query the Work database in order to retrieve specified lists.

Maps define the Tasks and Links between the tasks. When a Map is Initiated Work is created. Map definitions may either be saved in the database or Initiated directly from the definition.

The Work database represents the current status of all Work in progress. The Work database refers to the Map database for all execution information.

The followings are types of WAPI object handles used with the WAPI functions:

Class Attributes

An audit trail constant specifying that a sub-workflow finished.

An audit trail constant specifying that a sub-workflow started.

An audit trail constant specifying that a sub-workflow map definition was modified.

An audit trail constant specifying that a task assigned to a group was accepted by a member of the group.

An audit trail constant specifying that the task's send on \ processing has been completed in the background using the Workflow Agent.

An audit trail constant specifying that work on a task (in the base system, this includes any automatically processed step or Item Handler step) has been started in the background using the Workflow Agent.

An audit trail constant specifying that a task has been cancelled.

An audit trail constant specifying that work on a task had been completed and the task has been marked as done.

An audit trail constant that specifies that the task was executing.

An audit trail constant specifying that work on a task had been finished for the current work period, but the task has not marked as done.

An audit trail constant specifying that a task was marked as killed.

An audit trail constant specifying that a task has become ready.

An audit trail constant specifying that a task was reassigned to a different user.

An audit trail constant specifying that a suspended task was resumed.

An audit trail constant specifying that a task was resurrected.

An audit trail constant specifying that work on a task was started.

An audit trail constant specifying that a task was suspended.

An audit trail constant specifying that a custom event was added to the audit trail.

An audit trail constant specifying that the workflow was Archived.

An audit trail constant specifying that the workflow was completed.

An audit trail constant specifying that the suspended workflow was resumed.

An audit trail constant specifying that the workflow was started.

An audit trail constant specifying that the workflow was stopped.

An audit trail constant specifying that the workflow was suspended.

A constant to specify that the False links should be taken.

A constant specifying that only entries where the current user was the initiator should be returned.

A constant specifying that only entries where the current user is the manager should be returned.

A constant specifying that only entries where the current user is the task performer should be returned.

A constant specifying that the Loop links should be taken.

A constant specifying that the workflow should automatically be Archived upon completion.

A constant specifying that the workflow should automatically be Deleted upon completion.

A constant specifying that the e-mail sent by the workflow will contain their attachments as files included with the e-mail.

A constant specifying that the e-mail sent by the workflow will contain their attachments as HTML links back into Livelink.

A constant specifying that when this Map is used for a sub-workflow and the sub-workflow completes, the task that started the sub-workflow should be marked as done and the workflow route continued.

A constant specifying that the workflow should skip weekends when calculating due date.

A constant specifying that the Map should automatically be Deleted when the workflow is deleted.

A constant specifying that the False branches from a task should be taken.

A constant specifying that the task should automatically become Done as soon as it becomes ready.

A constant specifying that the task's send on processing should occur in the background (by the Workflow Agent as a separate process).

A constant specifying that the task's has been e-mail enabled.

A constant specifying that the task should be marked as a Milestone task and Milestone dates calculated and stored.

A constant specifying that the task should invoke the recalculate due date processing when the task has been sent on.

A constant specifying that the Loopback branch from a task should be taken.

A constant specifying that the True branches from a task should be taken.

A constant specifying that the WAPI.StartTask() call should not add an event to the audit trail.

A constant specifying that the WAPI.StartTask() call should mark the task as started even if it was already marked as started.

A constant specifying the CustomData for a subWork in an update call.

A constant specifying that the workflow should automatically be Archived upon completion.

A constant specifying that the workflow should automatically be Deleted upon completion.

A constant specifying that when this workflow is used for a sub-workflow and the sub-workflow completes, the task that started the sub-workflow should be marked as done and the workflow route continued.

A constant specifying that the workflow should skip weekends when calculating due dates.

A constant specifying that the Map definition that is used by this workflow should be Deleted when the workflow is deleted.

A constant specifying the Flags for a subWorkflow in an update call.

A constant specifying the Project for a subWorkflow in an update call.

A status constant specifying that the subwork has completed.

A status constant specifying that the subwork has not yet completed.

A constant specifying the Title for a subWorkflow in an update call.

A constant specifying the UserData for a subWorkflow in an update call.

A constant specifying the CustomData for a workflow task in an update call.

A constant specifying that the task should automatically complete when it becomes ready.

A constant specifying that the task should be performed in the background (by the Workflow Agent). The Item Handler step is the only step that supports this capability.

A constant specifying that the task's send on processing should occur in the background (by the Workflow Agent as a separate process). This is used to gain efficiencies and performance improvements especially if the steps proceeding this step are auto-done steps ( for example, Evaluate, Process, Subworkflow, Milestone, etc.).

A constant specifying that the task should be a Milestone task and store a Milestone due date.

A constant specifying that the task should invoke the recalculate due date processing when the task has been sent on.

A constant specifying the Flags for a workflow task in an update call.

A constant specifying the PerformerID for a task in a workflow for an update call.

A status constant specifying that the task was deleted.

A status constant specifying that the task is done.

A status constant specifying that the task is executing.

A status constant specifying that the task is finished.

A status constant specifying that the task was killed.

A status constant specifying that the task is ready.

A status constant specifying that the task is ready in the background (only supported with the Item Handler step).

A status constant specifying that the task's send on processing is being performed in the background by the Workflow Agent.

A status constant specifying that the task is started.

A status constant specifying that the task is suspended.

A status constant specifying that the task is waiting to become ready.

A constant specifying the Title for a task in a workflow for an update call.

A constant specifying that the task is a Milestone task.

A constant specifying that the task is a Normal task and not a Milestone task.

A constant specifying the UserComment for a task in a workflow for an update call.

A constant specifying the UserData for a task in a workflow for an update call.

A constant specifying the UserStatus for a task in a workflow for an update call.

A constant specifying that the True links should be taken.

A constant specifying the CustomData for a workflow in an update call.

A constant specifying the Flags for a workflow in an update call.

A constant specifying the ManagerID for a workflow in an update call.

A constant specifying the OwnerID for a workflow in an update call.

A constant specifying the Project for a workflow in an update call.

A status constant specifying that the workflow has been Archived.

A status constant specifying that the workflow has been Completed.

A status constant specifying that the workflow is still executing.

A status constant specifying that the workflow has been Stopped.

A status constant specifying that the workflow has been Suspended.

A constant specifying the Title for a workflow in an update call.

A constant specifying the UserData for a workflow in an update call.

Class Methods

AcceptTask( WAPIWORK work, Integer workID, Integer subworkID, Integer taskID )

Assigns a step, that was previously assigned to a group, to the currently logged in user.

AccessWork( WAPIWORK work, Integer workID, [Integer subworkID] )

Sets up a WAPIWORK object handle to provide access to the data package of a workflow.

AddTaskLink( WAPIMAPTASK fromtask, Integer linktype, WAPIMAPTASK totask )

Adds a link of the specified type between the specified tasks.

AddWorkData( WAPIWORK work, Integer type, Integer subtype, String description, Dynamic value )

Creates and sets data stored in a data package.

AllocMap( WAPISESSION session )

Allocates a WAPIMAP object handle.

AllocMapTask( WAPIMAP map )

Allocates a WAPIMAPTASK object handle.

AllocNthMapTask( WAPIMAP map, Integer taskID )

Allocate a WAPIMAPTASK object handle for a particular task in a workflow map definition.

AllocSession( CAPILOGIN login )

Allocates a WAPISESSION object for a login user.

AllocSubWork( WAPIWORK work )

Allocates a WAPISUBWORK object for the specified WAPIWORK object.

AllocWork( WAPISESSION session )

Allocates a WAPIWORK object.

ArchiveWork( WAPIWORK work, Integer workID )

Sets the status of a Stopped or Completed workflow to Archived.

CallSubWork( WAPIWORK work )

Initiates a Sub-Workflow using the information supplied in a previous call to WAPI.PrepareSubMap() or WAPI.PrepareSubWork().

ColumnStringToValue( WAPISESSION session, RecArray array, String colName )

Converts the values returned by a call to WAPI.WorkList() from Strings to their true values.

DeleteMapByID( WAPISESSION session, Integer mapID )

Deletes the Map from the Map database with the specified mapID.

DeleteMapTask( WAPIMAPTASK task )

Deletes the task from the map definition.

DeleteTaskLink( WAPIMAPTASK fromTask, Integer linkType, WAPIMAPTASK toTask )

Deletes the link from the specified tasks.

DeleteWork( WAPIWORK work, Integer workID )

Deletes the specified Stopped or Completed workflow.

DeleteWorkData( WAPIWORK work, Integer type, Integer subtype )

Deletes data from the Data Package specified by type and subtype.

FreeMap( WAPIMAP map )

Frees the memory held by the WAPIMAP object.

FreeMapTask( WAPIMAPTASK task )

Frees the memory held by the WAPIMAPTASK object.

FreeSession( WAPISESSION session )

Logs out the given WAPISESSION object and frees the associated memory.

FreeSubWork( WAPISUBWORK subWork )

Frees the memory held by the WAPISUBWORK object.

FreeWork( WAPIWORK work )

Frees the memory held by the WAPIWORK object.

GetTaskLinks( WAPIMAPTASK task, Integer linkType )

Gets a List of the task ids for all links of the specified type for the specified task.

GetWorkData( WAPIWORK work, Integer type, Integer subtype )

Gets the data specified by the given type and subtype stored in the data package.

ListWorkData( WAPIWORK work, Boolean allWork )

Returns the data that was stored for the specified work.

LLMapToWMap( WAPIMAP map, RecArray mapInfo, RecArray tasks, RecArray links )

Takes a map definition from Livelink OScript and converts it to a WAPIMAP definition.

LoadMapByID( WAPIMAP map, Integer mapID )

Loads the map information from the Map database for the map with the specified ID.

LoadTaskStatus( WAPISESSION session, Integer workID, [Integer subWorkID], [Integer taskID] )

Loads the task information for the specified workID, subWorkID, and taskID.

LoadWorkAudit( WAPISESSION session, Integer workID, [Integer subWorkID], [Integer taskID] )

Loads the audit trail for the specified workID, subWorkID, and taskID.

LoadWorkStatus( WAPISESSION session, Integer workID, [Integer subWorkID], [Integer taskID] )

Loads the information about a workflow.

PrepareMap( WAPIWORK work, WAPIMAP map, [Integer flags] )

Saves the map definition to the map database and sets up the work object for workflow initiation.

PrepareSubMap( WAPIWORK work, WAPIMAP map, [Integer flags] )

Saves the map definition to the map database and sets up the work object to initiate the map as a sub-workflow.

PrepareSubWork( WAPIWORK work, Integer mapID, [Integer flags] )

Sets up the work object to initiate the specified map as a subworkflow.

PrepareWork( WAPIWORK work, Integer mapID, [Integer flags] )

Sets up the work object to initiate the specified map as a workflow.

ReassignTask( WAPIWORK work, Integer workID, Integer subWorkID, Integer taskID, Integer userID )

Reassigns the task specified by the workID, subWorkID, and taskID to the given userID.

ReplaceMap( WAPIMAP map )

Saves the modified map definition to the map database replacing the original.

ResumeWork( WAPIWORK work, Integer workID )

Sets the status of a suspended workflow to Executing.

SaveMap( WAPIMAP map )

Saves a WAPIMAP map definition to the map database.

SetCallback( WAPISESSION session, Dynamic feature, [Dynamic object] )

Specifies the WAPI callback routine and context argument that is passed to the callback.

SetWorkData( WAPIWORK work, Integer type, Integer subtype, [String description, Dynamic value )

Sets data stored in a data package.

StartTask( WAPIWORK work, Integer workID, Integer subWorkID, Integer taskID, Integer flags )

Marks the specified task as started and sets up the given WAPIWORK object handle to be able to access the work package.

StartWork( WAPIWORK work, [String title )

Initiates a workflow that was prepared with a call to WAPI.PrepareWork() and readies any initial tasks.

StopWork( WAPIWORK work, Integer workID )

Sets the status of an Executing or Suspended workflow to Stopped.

SuspendWork( WAPIWORK work, Integer workID )

Sets the status of an Executing workflow to Suspended.

TaskAuditUserData( WAPIWORK work, Integer workID, Integer subworkID, Integer taskID, Dynamic data, [Integer iterNum )

Adds a row to the audit trail and stores the specified data.

TaskCancel( WAPIWORK work )

Notifies the workflow engine that work on this task is completed for the time being but skip marking the task as Done and send the workflow on to the next step.

TaskDone( WAPIWORK work, [Dynamic linkType] )

Marks the task as Done and takes the paths from the task that are of the specified link type.

UpdateSubWorkAttribute( WAPIWORK work, Integer workID, Integer subWorkID, Integer attribute, Dynamic value )

Updates the value of a subWork attribute for a workflow.

UpdateSubWorkPrepare( WAPIWORK work, WAPIMAP map, Integer workID, Integer subWorkID )

Prepares the map and work object for a workflow already in process for update.

UpdateSubWorkStart( WAPIWORK work )

Updates the in-process workflow specified by work.

UpdateTaskAttribute( WAPIWORK work, Integer workID, Integer subWorkID, Integer taskID, Integer attribute, Dynamic value )

Updates the value of a task attribute for a workflow.

UpdateWorkAttribute( WAPIWORK work, Integer workID, Integer attribute, Dynamic value )

Updates the value of a work attribute.

WorkList( WAPISESSION session, String viewName, Dynamic whereClause, Integer flags )

Returns workflow information using the specified view, where clause, and flags.

WorkList2( WAPISESSION session, String viewName, Dynamic whereClause, Dynamic orderby, Integer flags )

Returns workflow information using the specified view, where clause, orderby clause, and flags.

Class Attributes

An audit trail constant specifying that a sub-workflow finished.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a sub-workflow started.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a sub-workflow map definition was modified.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a task assigned to a group was accepted by a member of the group.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the task's send on processing has been done in the background using the Workflow Agent.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that work on a task (in the base system this includes any auto done step or Item Handler step) has been started in the background using the Workflow Agent.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a task as been cancelled.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that work on a task had been completed and the task marked as done.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the task was executing.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that work on a task had been finished for the current work period, but the task was not marked as done.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a task was marked as killed.

This indicates that the path containing the task was not taken as the result of an evaluation. The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a task became ready.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

Integer FALSE

An audit trail constant specifying that a task was reassigned to a different user.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a suspended task was resumed.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

Integer LOOP

An audit trail constant specifying that a task was resurrected.

This indicates that a loopback occurred and the path containing the task is once again available. The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that work on a task was started.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a task was suspended.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that a custom event was added to the audit trail.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the workflow was archived.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the workflow was completed.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the suspended workflow was resumed.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the workflow was started.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

An audit trail constant specifying that the workflow was stopped.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

This constant can be combined with other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that the task should automatically become Done as soon as it becomes ready.

A constant specifying that the task's send on processing should occur in the background (by the Workflow Agent as a separate process). This is used to gain efficiencies and performance improvements especially if the steps proceeding this step are autodone steps ( for example, Evaluate, Process, Subworkflow, Milestone, etc.).

A constant specifying that the task has been e-mail enabled. When this task becomes ready, an e-mail will be sent to the Assignee(s) allowing the task to be completed through e-mail.

A constant specifying that the task should be marked as a Milestone task and Milestone dates should be calculated and stored.

A constant specifying that the task should invoke the recalculate due date processing when the task has been sent on.

A constant specifying that the False branches from a task should be taken. This constant should be used as the linkType for a call to WAPI.TaskDone().

A constant specifying that the Loopback branch from a task should be taken. This constant should be used as the linkType for a call to WAPI.TaskDone().

A constant specifying that the True branches from a task should be taken. This constant should be used as the linkType for a call to WAPI.TaskDone().

A constant specifying that the WAPI.StartTask() call should not add an event to the audit trail.

A constant specifying that the WAPI.StartTask() call should mark the task as started even if it was already marked as started.

A constant specifying the CustomData for a workflow task in an update call.

An audit trail constant specifying that the workflow was suspended.

A constant specifying that the False links should be taken.

This constant is used by the WAPI.TaskDone() function as the flag indicating which link types should be taken coming from the task.

A constant specifying that only entries where the current user was the initiator should be returned.

This constant is used as a bit-mask flag for the call WAPI.WorkList().

A constant specifying that only entries where the current user is the manager should be returned.

The constant is returned in the WorkAudit_Status column of the RecArray returned by a call to WAPI.LoadWorkAudit().

This constant is used as a bit-mask flag for the call WAPI.WorkList().

A constant specifying that only entries where the current user is the task performer should be returned.

This constant is used as a bit-mask flag for the call WAPI.WorkList(). This flag is used to determine the ToDo list for a user.

A constant specifying that the Loop links should be taken.

This constant is used by the WAPI.TaskDone() function as the flag indicating which link types should be taken coming from the task.

A constant specifying that the workflow should automatically be Archived upon completion.

This constant can be combined with the other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that the workflow should automatically be Deleted upon completion.

This constant can be combined with other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that the e-mail sent by the workflow will contain their attachments as files included with the e-mail.

This constant can be combined with other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that the e-mail sent by the workflow will contain their attachments as HTML links back into Livelink.

This constant can be combined with other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that when this Map is used for a sub-workflow and the sub-workflow completes, the task that started the sub-workflow should be marked as done and the workflow route continued.

This constant can be combined with other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that the workflow should skip weekends when calculating due date.

This constant can be combined with other Map_Flag constants by Bitwise OR and used to set the Flag field for a Map to control workflow actions.

A constant specifying that the Map should automatically be Deleted when the workflow is deleted.

Integer TRUE

Use this constant with the call WAPI.UpdateTaskAttribute().

A constant specifying the Flags for a workflow task in an update call.

Integer WORK_FLAGS

Use this constant with the call WAPI.UpdateTaskAttribute().

A constant specifying that the task should automatically complete when it becomes ready.

Integer WORK_OWNERID

Use this constant with the call WAPI.UpdateTaskAttribute() when setting the task Flags with the WAPI.SUBWORKTASK_FLAGS constant.

Integer WORK_PROJECT

A constant specifying that the task should be performed in the background (by the Workflow Agent). The Item Handler step is the only step that supports this capability.

Use this constant with the call WAPI.UpdateTaskAttribute() when setting the task Flags with the WAPI.SUBWORKTASK_FLAGS constant.

A constant specifying that the task's send on processing should occur in the background (by the Workflow Agent as a separate process). This is used to gain efficiencies and performance improvements especially if the steps proceeding this step are autodone steps ( for example, Evaluate, Process, Subworkflow, Milestone, etc.).

Use this constant with the call WAPI.UpdateTaskAttribute() when setting the task Flags with the WAPI.SUBWORKTASK_FLAGS constant.

A constant specifying that the task should be a Milestone task and store a Milestone due date.

Use this constant with the call WAPI.UpdateTaskAttribute() when setting the task Flags with the WAPI.SUBWORKTASK_FLAGS constant.

Integer WORK_TITLE

A constant specifying that the task should invoke the recalculate due date processing when the task has been sent on.

Use this constant with the call WAPI.UpdateTaskAttribute() when setting the task Flags with the WAPI.SUBWORKTASK_FLAGS constant.

Class Methods

AcceptTask

Integer AcceptTask( WAPIWORK work,
                    Integer workID,
                    Integer subworkID,
                    Integer taskID )

Assigns a step that was previously assigned to a group to the currently logged in user.

This call changes the SubWorkTask_PerformerID column in the WSubWorkTask table to the ID of the currently logged in user.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

subworkID

The subworkID for the desired sub-workflow.

taskID

The taskID for the desired step.

Returns:

(Integer 0) if successful; Error otherwise.

AccessWork

Integer AccessWork( WAPIWORK work,
                    Integer workID,
                    [Integer subworkID] )

Sets up a WAPIWORK object handle to provide access to the data package of a workflow.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

subworkID

The optional subworkID for the desired sub-workflow.

Returns:

(Integer 0) if successful; Error otherwise.

AddTaskLink

Integer AddTaskLink( WAPIMAPTASK fromtask,
                     Integer linktype,
                     WAPIMAPTASK totask )

Adds a link, of the specified type, between the specified tasks.

Parameters

fromtask

The WAPIMAPTASK handle specifying the task the link should come from.

linktype

Specifies a constant indicating the link type, can be:

totask

The WAPIMAPTASK handle specifying the task the link should go to.

Returns:

(Integer 0) if successful; Error otherwise.

AddWorkData

Integer AddWorkData( WAPIWORK work,
                     Integer type,
                     Integer subtype,
                     String description,
                     Dynamic value )

Creates and sets data stored in a data package.

Parameters

work

The WAPIWORK object handle.

type

The data package type.

subtype

The data package subtype.

description

Optional description of the data.

value

The data value to store.

Returns:

(Integer 0) if successful; Error otherwise.

AllocMap

WAPIMAP AllocMap( WAPISESSION session )

Allocates a WAPIMAP object handle. This map handle is used to define workflow maps.

Parameters

session

The WAPISESSION object handle.

Returns:

The WAPIMAP object handle if successful; Error otherwise.

AllocMapTask

WAPIMAPTASK AllocMapTask( WAPIMAP map )

Allocates a WAPIMAPTASK object handle. This mapTask handle is used to define a task for a workflow map.

Parameters

map

The WAPIMAP object handle for the desired workflow map.

Returns:

The WAPIMAPTASK object handle if successful; Error otherwise.

AllocNthMapTask

WAPIMAPTASK AllocNthMapTask( WAPIMAP map,
                             Integer taskID )

Allocates a WAPIMAPTASK object handle for a particular task in a workflow map definition. This mapTask handle is used to define a task for a workflow map.

Parameters

map

The WAPIMAP object handle for the desired workflow map.

taskID

The id for the desired workflow task.

Returns:

The WAPIMAPTASK object handle if successful; Error otherwise.

AllocSession

WAPISESSION AllocSession( CAPILOGIN login )

Allocates a WAPISESSION object for a login user.

A WAPISESSION contains information pertaining to workflow management.

Parameters

login

The CAPILOGIN object handle specifically for the login user.

Returns:

The WAPISESSION object handle if successful; Error otherwise.

AllocSubWork

WAPISUBWORK AllocSubWork( WAPIWORK work )

Allocates a WAPISUBWORK object for the specified WAPIWORK object.

Parameters

work

The WAPIWORK object handle.

Returns:

The WAPISUBWORK object handle if successful; Error otherwise.

AllocWork

WAPIWORK AllocWork( WAPISESSION session )

Allocates a WAPIWORK object.

Parameters

session

The WAPISESSION object handle.

Returns:

The WAPIWORK object handle if successful; Error otherwise.

ArchiveWork

Integer ArchiveWork( WAPIWORK work,
                     Integer workID )

Sets the status of a Stopped or Completed workflow to Archived.

This changes the Work_Status field of the workflow to WAPI.WORK_STATUS_ARCHIVED.

Use a WAPIWORK object returned from a previous call to WAPI.AllocWork().

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

Returns:

(Integer 0) if successful; Error otherwise.

CallSubWork

Integer CallSubWork( WAPIWORK work )

Initiates a Sub-Workflow using the information supplied in a previous call to WAPI.PrepareSubMap() or WAPI.PrepareSubWork().

Parameters

work

The WAPIWORK object handle.

Returns:

(Integer 0) if successful; Error otherwise.

ColumnStringToValue

RecArray ColumnStringToValue( WAPISESSION session,
                              RecArray array,
                              String colName )

Converts the values returned by a call to WAPI.WorkList() from Strings to their true values.

Some pieces of data are stored as Strings or BLOBs in the WAPI database. To improve performance these values are returned as Strings and not their original type. If the original type of the data is required this call is used to convert the data from a String back to the original type.

Parameters

session

The WAPISESSION object handle.

array

The returned RecArray.

colName

The name of the column whose values should be converted.

Returns:

A RecArray with the values of the specified column name converted from a String to their original types.

DeleteMapByID

Integer DeleteMapByID( WAPISESSION session,
                       Integer mapID )

Deletes the Map from the Map database with the specified mapID.

Parameters

session

The WAPISESSION object handle.

mapID

The ID of the desired Map.

Returns:

(Integer 0) if successful; Error otherwise.

DeleteMapTask

Integer DeleteMapTask( WAPIMAPTASK task )

Deletes the task from the map definition. This task was determined using WAPI.AllocMapTask() or WAPI.AllocNthMapTask().

Parameters

task

The WAPIMAPTASK object handle.

Returns:

(Integer 0) if successful; Error otherwise.

DeleteTaskLink

Integer DeleteTaskLink( WAPIMAPTASK fromTask,
                        Integer linkType,
                        WAPIMAPTASK toTask )

Deletes the link from the specified tasks.

Parameters

fromTask

The WAPIMAPTASK handle specifying the task the link comes from.

linkType

Specifies a constant indicating the link type, can be:

toTask

The WAPIMAPTASK handle specifying the task the link goes to.

Returns:

(Integer 0) if successful; Error otherwise.

DeleteWork

Integer DeleteWork( WAPIWORK work,
                    Integer workID )

Deletes the specified Stopped or Completed workflow.

Use a WAPIWORK object returned from a previous call to WAPI.AllocWork().

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

Returns:

(Integer 0) if successful; Error otherwise.

DeleteWorkData

Integer DeleteWorkData( WAPIWORK work,
                        Integer type,
                        Integer subtype )

Deletes data from the Data Package specified by the type and subtype.

Use a WAPIWORK object returned from a previous call to WAPI.AccessWork().

Parameters

work

The WAPIWORK object handle.

type

The type of data in the Data Package.

subtype

The subtype of data in the Data Package.

Returns:

(Integer 0) if successful; Error otherwise.

FreeMap

Integer FreeMap( WAPIMAP map )

Frees the memory held by the WAPIMAP object.

Parameters

map

The WAPIMAP object handle.

Returns:

(Integer 0) if successful; Error otherwise.

FreeMapTask

Integer FreeMapTask( WAPIMAPTASK task )

Frees the memory held by the WAPIMAPTASK object.

Parameters

task

The WAPIMAPTASK handle.

Returns:

(Integer 0) if successful; Error otherwise.

FreeSession

Integer FreeSession( WAPISESSION session )

Logs out the WAPISESSION object and frees any associated memory.

Parameters

session

The WAPISESSION object handle.

Returns:

(Integer 0) if successful; Error otherwise.

FreeSubWork

Integer FreeSubWork( WAPISUBWORK subWork )

Frees the memory held by the WAPISUBWORK object.

Parameters

subWork

The WAPISUBWORK object handle.

Returns:

(Integer 0) if successful; Error otherwise.

FreeWork

Integer FreeWork( WAPIWORK work )

Frees the memory held by the WAPIWORK object.

Parameters

work

The WAPIWORK object handle.

Returns:

(Integer 0) if successful; Error otherwise.

GetTaskLinks

List GetTaskLinks( WAPIMAPTASK task,
                   Integer linkType )

Gets a List of the task ids for all links of the specified types for the specified task.

Parameters

task

The WAPIMAPTASK handle.

linkType

Specifies a constant indicating the link type, can be: * WAPI.MAPTASK_FALSELINKS * WAPI.MAPTASK_LOOPLINKS * WAPI.MAPTASK_TRUELINKS

Returns:

A List of task ids if successful; Error otherwise.

GetWorkData

Dynamic GetWorkData( WAPIWORK work,
                     Integer type,
                     Integer subtype )

Gets the data from the specified type and subtype stored in the data package.

Parameters

work

The WAPIWORK object handle.

type

The type of data in the Data Package.

subtype

The subtype of data in the Data Package.

Returns:

The data from the data package; Error otherwise.

ListWorkData

RecArray ListWorkData( WAPIWORK work,
                       Boolean allWork )

Returns the data that was stored for the specified work.

Parameters

work

The WAPIWORK object handle.

allWork

Optional parameter used to specify whether all the data, including any subworkflow data, should be returned. By default allWork is set to False.

Returns:

A RecArray of work data if successful; error otherwise.

LLMapToWMap

Integer LLMapToWMap( WAPIMAP map,
                     RecArray mapInfo,
                     RecArray tasks,
                     RecArray links )

Takes a map definition from Livelink OScript and converts it to a WAPIMAP definition.

Parameters

map

The WAPIMAP object handle.

mapInfo

A RecArray with only one row which describes various properties of the map.

tasks

A RecArray with one row for each task to add to the map definition.

links

A RecArray with one row for each link to add to the map definition.

Returns:

(Integer 0) if successful; Error otherwise.

LoadMapByID

Integer LoadMapByID( WAPIMAP map,
                     Integer mapID )

Loads the map information from the Map database for the map with the specified ID.

Allocate a WAPIMAP object then use this call to populate the WAPIMAP data.

Parameters

map

The WAPIMAP object handle.

mapID

The ID for the desired map.

Returns:

(Integer 0) if successful; Error otherwise.

LoadTaskStatus

RecArray LoadTaskStatus( WAPISESSION session,
                         Integer workID,
                         [Integer subWorkID],
                         [Integer taskID] )

Loads the task information for the specified workID, subWorkID, and taskID.

If only the workID is specified then the returned RecArray will contain 1 row for every task in every subWork for the work with the given workID. If the workID and subWorkID are specified then the RecArray will contain 1 row for every task in the subWork for the given workID and subWorkID. If the workID, subWorkID, and taskID are specified then only 1 row will be returned for the desired task.

Parameters

session

The WAPISESSION object handle.

workID

The workID for the desired workflow.

subWorkID

The optional subWorkID for the desired sub-workflow.

taskID

The optional taskID for the desired workflow task.

Returns:

A RecArray of task information if successful; Error otherwise.

LoadWorkAudit

RecArray LoadWorkAudit( WAPISESSION session,
                        Integer workID,
                        [Integer subWorkID],
                        [Integer taskID] )

Loads the audit trail for the specified workID, subWorkID, and taskID.

If only the workID is specified then the returned RecArray will contain the audit information for every subWork and task for the work with the given workID. If the workID and subWorkID are specified then the RecArray will contain the audit information for the given workID and subWorkID. If the workID, subWorkID, and taskID are specified then only the audit information for the desired task will be returned.

Parameters

session

The WAPISESSION object handle.

workID

The workID for the desired workflow.

subWorkID

The optional subWorkID for the desired sub-workflow.

taskID

The optional taskID for the desired workflow task.

Returns:

A RecArray of audit information if successful; Error otherwise.

LoadWorkStatus

List LoadWorkStatus( WAPISESSION session,
                     Integer workID,
                     [Integer subWorkID],
                     [Integer taskID] )

Loads the information for a workflow. You can optionally limit the amount of data returned by specifying a subWorkID and a taskID. A List of 3 RecArrays is returned where the first RecArray contains information about the workflow as a whole, the second RecArray contains information about the sub-workflows, and the third RecArray contains information about the workflow tasks.

Parameters

session

The WAPISESSION object handle.

workID

The workID for the desired workflow.

subWorkID

The optional subWorkID for the desired sub-workflow.

taskID

The optional taskID for the desired workflow task.

Returns:

A List of 3 RecArrays if successful; Error otherwise.

PrepareMap

Integer PrepareMap( WAPIWORK work,
                    WAPIMAP map,
                    [Integer flags] )

Saves the map definition to the map database and sets up the work object for workflow initiation.

Parameters

work

The WAPIWORK object handle.

map

The WAPIMAP object handle for the desired map.

Returns:

(Integer 0) if successful; Error otherwise.

PrepareSubMap

Integer PrepareSubMap( WAPIWORK work,
                       WAPIMAP map,
                       [Integer flags] )

Saves the map definition to the map database and sets up the work object to initiate the map as a sub-workflow.

Parameters

work

The WAPIWORK object handle.

map

The WAPIMAP object handle for the desired map.

Returns:

(Integer 0) if successful; Error otherwise.

PrepareSubWork

Integer PrepareSubWork( WAPIWORK work,
                        Integer mapID,
                        [Integer flags] )

Sets up the work object to initiate the specified map as a subworkflow.

Parameters

work

The WAPIWORK object handle.

mapID

The ID of the desired Workflow Map.

Returns:

(Integer 0) if successful; Error otherwise.

PrepareWork

Integer PrepareWork( WAPIWORK work,
                     Integer mapID,
                     [Integer flags] )

Sets up the work object to initiate the specified map as a workflow.

Parameters

work

The WAPIWORK object handle.

mapID

The ID of the desired Workflow Map.

Returns:

(Integer 0) if successful; Error otherwise.

ReassignTask

Integer ReassignTask( WAPIWORK work,
                      Integer workID,
                      Integer subWorkID,
                      Integer taskID,
                      Integer userID )

Reassigns the task specified by the workID, subWorkID, and taskID to the given userID.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

subWorkID

The subWorkID for the desired workflow.

taskID

The taskID for the desired workflow task.

userID

The ID of the user to which the task should be reassigned.

Returns:

(Integer 0) if successful; Error otherwise.

ReplaceMap

Integer ReplaceMap( WAPIMAP map )

Saves the modified map definition to the map database replacing the original.

Parameters

map

The WAPIMAP object handle.

Returns:

(Integer 0) if successful; Error otherwise.

ResumeWork

Integer ResumeWork( WAPIWORK work,
                    Integer workID )

Sets the status of a suspended workflow to Executing.

This changes the Work_Status field of the workflow to WAPI.WORK_STATUS_EXECUTING.

Use a WAPIWORK object returned from a previous call to WAPI.AllocWork().

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

Returns:

(Integer 0) if successful; Error otherwise.

SaveMap

Integer SaveMap( WAPIMAP map )

Saves a WAPIMAP map definition to the map database.

Parameters

map

The WAPIMAP object handle.

Returns:

The ID for the new map if successful; Error otherwise.

SetCallback

Integer SetCallback( WAPISESSION session,
                     Dynamic feature,
                     [Dynamic object] )

Specifies the WAPI callback routine and context argument that is passed to the callback.

Parameters

session

The WAPISESSION object handle.

feature

The name of the script to execute.

object

The optional object that contains the script.

Returns:

(Integer 0) if successful; Error otherwise.

SetWorkData

Integer SetWorkData( WAPIWORK work,
                     Integer type,
                     Integer subtype,
                     [String description,
                     Dynamic value )

Sets data stored in a data package.

Parameters

work

The WAPIWORK object handle.

type

The type of the data.

subtype

The subtype of the data.

description

The optional description of the data.

value

The data to store.

Returns:

(Integer 0) if successful; Error otherwise.

StartTask

Integer StartTask( WAPIWORK work,
                   Integer workID,
                   Integer subWorkID,
                   Integer taskID,
                   Integer flags )

Marks the specified task as started and sets up the WAPIWORK object handle to be able to access the work package.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

subWorkID

The subWorkID for the desired workflow.

taskID

The taskID for the desired workflow task.

flags

A flag for StartTask options. This flag can be combined by Bitwise OR using the following constants:

Returns:

(Integer 0) if successful; Error otherwise.

StartWork

Integer StartWork( WAPIWORK work,
                   [String title )

Initiates a workflow that was prepared with a call to WAPI.PrepareWork() and readies any initial tasks.

Parameters

work

The WAPIWORK object handle.

title

The optional title of the Workflow.

Returns:

(Integer 0) if successful; Error otherwise.

StopWork

Integer StopWork( WAPIWORK work,
                  Integer workID )

Sets the status of an Executing or Suspended workflow to Stopped.

This changes the Work_Status field of the workflow to WAPI.WORK_STATUS_STOPPED.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

Returns:

(Integer 0) if successful; Error otherwise.

SuspendWork

Integer SuspendWork( WAPIWORK work,
                     Integer workID )

Sets the status of an Executing workflow to Suspended.

This changes the Work_Status field of the workflow to WAPI.WORK_STATUS_SUSPENDED.

Use a WAPIWORK object returned from a previous call to WAPI.AllocWork().

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

Returns:

(Integer 0) if successful; Error otherwise.

TaskAuditUserData

Integer TaskAuditUserData( WAPIWORK work,
                           Integer workID,
                           Integer subworkID,
                           Integer taskID,
                           Dynamic data,
                           [Integer iterNum )

Adds a row to the audit trail and stores the specified data. Even though the iterNum parameter is optional, if not specified the iternum will be accessed from the appropriate Workflow database table by using the workID, subworkID and taskID. If you already have the iterNum, it is more efficient to pass it in instead of having the function access it.

Parameters

work

The WAPIWORK object handle.

workID

The work ID of the Workflow

subworkID

The subwork ID of the Workflow

taskID

The task ID of the task

data

The data to store.

iterNum

The optional iteration number for this specific task

Returns:

(Integer 0) if successful; Error otherwise.

TaskCancel

Integer TaskCancel( WAPIWORK work )

Notifies the workflow engine that work on this task is completed for the time being but skip marking the task as Done and send the workflow on to the next step.

Parameters

work

The WAPIWORK object handle.

Returns:

(Integer 0) if successful; Error otherwise.

TaskDone

Integer TaskDone( WAPIWORK work,
                  [Dynamic linkType] )

Marks the task as Done and takes the paths from the task that are of the specified link type. If the linkType is not specified, then the True/Normal paths will be taken.

Parameters

work

The WAPIWORK object handle.

linkType

The optional type of link paths that should be taken from this step.

Returns:

(Integer 0) if successful; Error otherwise.

UpdateSubWorkAttribute

Integer UpdateSubWorkAttribute( WAPIWORK work,
                                Integer workID,
                                Integer subWorkID,
                                Integer attribute,
                                Dynamic value )

Updates the value of a subWork attribute for a workflow.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

subWorkID

The subWorkID for the desired workflow.

attribute

Specifies a constant indicating the subWork attribute. Acceptable values are:

value

The new value for the attribute.

Returns:

(Integer 0) if successful; Error otherwise.

UpdateSubWorkPrepare

Integer UpdateSubWorkPrepare( WAPIWORK work,
                              WAPIMAP map,
                              Integer workID,
                              Integer subWorkID )

Prepares the map and work object for a workflow already in-process for update. The new map definition is saved to the map database. The in-process workflow must be suspended in order for this call to succeed.

Parameters

work

The WAPIWORK object handle.

map

The WAPIMAP object handle.

workID

The workID for the desired workflow.

subWorkID

The subWorkID for the desired workflow.

Returns:

(Integer 0) if successful; Error otherwise.

UpdateSubWorkStart

Integer UpdateSubWorkStart( WAPIWORK work )

Updates the in-process workflow specified by work. This is used after a call to WAPI.UpdateSubWorkPrepare(). Here, the work information is updated, and the workflow is made to now point to the new map definition.

Parameters

work

The WAPIWORK object handle.

Returns:

(Integer 0) if successful; Error otherwise.

UpdateTaskAttribute

Integer UpdateTaskAttribute( WAPIWORK work,
                             Integer workID,
                             Integer subWorkID,
                             Integer taskID,
                             Integer attribute,
                             Dynamic value )

Updates the value of a task attribute for a workflow.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

subWorkID

The subWorkID for the desired workflow.

taskID

The taskID for the desired task.

value

The new value for the attribute.

Returns:

(Integer 0) if successful; Error otherwise.

UpdateWorkAttribute

Integer UpdateWorkAttribute( WAPIWORK work,
                             Integer workID,
                             Integer attribute,
                             Dynamic value )

Updates the value of a work attribute.

Parameters

work

The WAPIWORK object handle.

workID

The workID for the desired workflow.

attribute

Specifies a constant indicating the work attribute. Acceptable values are:

value

The new value for the attribute.

Returns:

(Integer 0) if successful; Error otherwise.

WorkList

RecArray WorkList( WAPISESSION session,
                   String viewName,
                   Dynamic whereClause,
                   Integer flags )

Returns workflow information using the specified view, SQL "where" clause, and flags. If specific workflow information is required, a view can be constructed in the database schema, and this call can be used to select rows from that view.

Parameters

session

The WAPISESSION object handle.

viewName

The view to do the select from

whereClause

An SQL "where" clause if one is desired, 0 or Undefined if not.

flags

Flag value for built-in "where" clauses. These flags can be combined by Bitwise OR using the following constants:

Returns:

A RecArray of work information if successful; Error otherwise.

WorkList2

RecArray WorkList2( WAPISESSION session,
                    String viewName,
                    Dynamic whereClause,
                    Dynamic orderby,
                    Integer flags )

Returns ordered Workflow information using the specified view, SQL "where" clause, SQL "orderby" clause and flags. If specific Workflow information is required, a view can be constructed in the database schema, and this call can be used to select rows from that view.

Parameters

session

The WAPISESSION object handle.

viewName

The view to do the select from

whereClause

An SQL "where" clause if one is desired, 0 or Undefined if not.

orderby

An SQL "orderby" to order the results.

flags

Flag value for built-in "where" clauses. These flags can be combined by Bitwise OR using the following constants:

Returns:

A RecArray of work information if successful; Error otherwise.

 Copyright © 2021 OpenText Corporation. All rights reserved.