GetSchedulableEntities Method
- Last UpdatedNov 06, 2025
- 3 minute read
'Declaration
Public Shared Function GetSchedulableEntities( _
ByVal woId As String, _
ByVal operId As String, _
ByVal windowId As Nullable(Of Integer) _
) As DataSet
'Usage
Dim woId As String
Dim operId As String
Dim windowId As Nullable(Of Integer)
Dim value As DataSet
value = JobExec.GetSchedulableEntities(woId, operId, windowId)
Parameters
- woId
- Required. Holds the ID of the work order by which to filter the results.
- operId
- Required. Holds the ID of the operation by which to filter the results.
- windowId
- Optional. Holds an integer that indicated the user interface context that is triggering this request. 0 if job; 1 if queue. Defaults to 0.
Return Value
Returns a DataSet that contains a record for each entity that can schedule jobs. If no such entities are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
|
Column Name |
Description |
|---|---|
|
root_ent_id |
An integer that is the ID of the root entity, from the ent.ent_id column. The entity returned in this column does not have any parents; hence, this entity is always considered as the topmost entity in the entity hierarchy. |
|
ent_id |
An integer that is the entity ID, from the ent.ent_id column. |
|
ent_name |
A string that is the name of the entity, from the ent.ent_name column. |
|
can_sched_jobs |
A Boolean that is a flag that indicates whether this entity can schedule jobs, from the ent.can_sched_jobs column. |
|
parent_ent_id |
An integer that is the ID of the immediate parent entity for the ent_id column retrieved, from the ent.parent_ent_id column. |
|
parent_ent_name |
A string that is the name of the parent entity, from the ent.ent_name column linked to this parent_ent_id column. |
|
child_level |
An integer that is the entity hierarchy. For example, 1 represents the top level entity, which does not have any parent; 2 represents the first child entity, whose parent is the topmost entity; 3 represents the grandchild for the topmost entity, and so on. |
|
ent_tree |
A string that is a list of ancestor entities, from the topmost entity but excluding this entity, separated by hyphen. For example, 1-101-1001 represents 1 being the topmost entity, 101 represents the child for 1, and 1001 represents the child for 101, and 1001 represents the parent entity for this entity. |
If this method is called with the context of a job, then the system attribute: 218, “Limit Schedulable Entities on Jobs Window,” is used to determine whether to limit the entities that are linked to this process (wo.process) and operation. That is, if the system attribute above is set to true, then the entities that can schedule jobs are limited to those that are direct ancestors for this process and the supplied operation (oper_ent_link.process_id = wo.process and oper_ent_link.oper_id = supplied operation). Any other entities or descendants are not returned as schedulable even though some of them are schedulable.
To limit the number of schedulable entities, there must be at least one entity that is linked to a process and operation. Otherwise, none of the entities will be limited when they are returned.
Note that this method does not limit the schedulable entities when the system attribute “Limit Schedulable Entities on Queue Window” (attr_id = 328) for queue is turned on.