CreateWOFromProcessAsync(Int32,String,String,String,String,Double,String,Nullable<Double>,Nullable<Int32>,String,Nullable<DateTime>,Nullable<DateTime>,Nullable<Int32>,String,String,String,String,String,String,Nullable<Boolean>,Nullable<Boolean>,Nullable<Int32>,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 5 minute read
The CreateWOFromProcessAsync() method creates instance data for a work order based on a specified process ID and other work order instance-specific data asynchronously.
For creating a new data entry job, see the JobExec class StartDataEntryJob() method. For adding a job to an existing work order, see the Job class Add() method.
This overload of the method includes the targetScheduledLineId and queueSequenceNumber input parameters, so that it can also assign the work order to a line. For more information, see the Remarks section.
'Declaration
Public Overloads Shared Sub CreateWOFromProcessAsync( _
ByVal sessionId As Integer, _
ByVal entName As String, _
ByVal woId As String, _
ByVal processId As String, _
ByVal itemId As String, _
ByVal reqQuantity As Double, _
ByVal userId As String, _
ByVal startQty As Nullable(Of Double), _
ByVal initWoState As Nullable(Of Integer), _
ByVal woDesc As String, _
ByVal releaseTime As Nullable(Of Date), _
ByVal reqFinishTime As Nullable(Of Date), _
ByVal woPriority As Nullable(Of Integer), _
ByVal custInfo As String, _
ByVal moId As String, _
ByVal productionScheduleId As String, _
ByVal notes As String, _
ByVal bomVerId As String, _
ByVal specVerId As String, _
ByVal forFirstOp As Nullable(Of Boolean), _
ByVal mayOverrideRoute As Nullable(Of Boolean), _
ByVal targetScheduledLineId As Nullable(Of Integer), _
ByVal queueSequenceNumber As Nullable(Of Integer) _
)
'Usage
Dim sessionId As Integer
Dim entName As String
Dim woId As String
Dim processId As String
Dim itemId As String
Dim reqQuantity As Double
Dim userId As String
Dim startQty As Nullable(Of Double)
Dim initWoState As Nullable(Of Integer)
Dim woDesc As String
Dim releaseTime As Nullable(Of Date)
Dim reqFinishTime As Nullable(Of Date)
Dim woPriority As Nullable(Of Integer)
Dim custInfo As String
Dim moId As String
Dim productionScheduleId As String
Dim notes As String
Dim bomVerId As String
Dim specVerId As String
Dim forFirstOp As Nullable(Of Boolean)
Dim mayOverrideRoute As Nullable(Of Boolean)
Dim targetScheduledLineId As Nullable(Of Integer)
Dim queueSequenceNumber As Nullable(Of Integer)
JobExec.CreateWOFromProcessAsync(sessionId, entName, woId, processId, itemId, reqQuantity, userId, startQty, initWoState, woDesc, releaseTime, reqFinishTime, woPriority, custInfo, moId, productionScheduleId, notes, bomVerId, specVerId, forFirstOp, mayOverrideRoute, targetScheduledLineId, queueSequenceNumber)
public static void CreateWOFromProcessAsync(
int sessionId,
string entName,
string woId,
string processId,
string itemId,
double reqQuantity,
string userId,
Nullable<double> startQty,
Nullable<int> initWoState,
string woDesc,
Nullable<DateTime> releaseTime,
Nullable<DateTime> reqFinishTime,
Nullable<int> woPriority,
string custInfo,
string moId,
string productionScheduleId,
string notes,
string bomVerId,
string specVerId,
Nullable<bool> forFirstOp,
Nullable<bool> mayOverrideRoute,
Nullable<int> targetScheduledLineId,
Nullable<int> queueSequenceNumber
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the work order is being created.
- entName
- Required. Holds the name of the entity.
- woId
- Required. Holds the ID of the work order.
- processId
- Required. Holds the ID of the process from which this work order is being created.
- itemId
- Required. Holds the ID of the final item to be made by this work order. (The same process can be used to make multiple items.)
- reqQuantity
- Required. Holds the quantity of the final item to be made.
- userId
- Required. Holds the ID of the user who is creating this work order.
- startQty
- Optional. Holds the required start quantity. The default is null.
- initWoState
- Optional. Holds the initial state of all jobs for the work order. The default is New (1).
- woDesc
- Optional. Holds the work order description. The default is the work order ID.
- releaseTime
- Optional. Holds the release time of the work order. The default is the current date and time.
- reqFinishTime
- Optional. Holds the required finish time of the work order. The default is the current date and time + 24 hours.
- woPriority
- Optional. Holds the priority of the work order and all its jobs. The default is 1.
- custInfo
- Optional. Holds the customer information. The default is an empty string.
- moId
- Optional. Holds the ID of the manufacturing order. The default is an empty string.
- productionScheduleId
- Optional. Holds the production schedule ID (for S95).
- notes
- Optional. Hold notes about the work order. The default is an empty string.
- bomVerId
- Optional. Holds the BOM version ID.
- specVerId
- Optional. Holds the ID of the specification version. The default is an empty string.
- forFirstOp
- Optional. Holds a flag that, if set to true, indicates that a quantity has been provided for the first operation.
- mayOverrideRoute
- Optional. Holds a flag that, if set to true, specifies that operations can be run out of sequence.
- targetScheduledLineId
- Optional. Holds the identifier for the line on which the work order is scheduled.
- queueSequenceNumber
- Optional. Holds the unique sequence number of the work order in the queue for the line.
To automatically queue a work order from the process to a line, the following guidelines must be followed:
- The targetScheduledLineId parameter must be set to the ID of the line to which the work order will be queued.
- The queueSequenceNumber parameter must be a unique sequence number for the work order in the line's queue. Note that MES Web Portal ignores this parameter and instead displays work orders alphabetically.
- The process operation structure must match the line layout. That is, the operations in the process must match the entity positions in the line. For example, if the process has the operations Roasting, Coating, and Bagging, then the line must have three positions, and only three positions, in its layout. Those positions must correspond to the three process operations.
- An entity at a position in the line has to be either one of the entities assigned to the corresponding process operation or a child of one of those entities in the entity tree. For example, let’s say that there is a Filler entity that has the child entities Filler1, Filler2, and Filler3. If Filler is assigned to the Filling process operation, then the entities at the corresponding position in the line can be either Filler, Filler1, Filler2, or Filler3.
- The process definition can be a template using area entities that can schedule jobs, while the line layout is a physical model with the entities that will run the jobs. Multiple line layouts can map to a single process definition.
- When creating all the jobs for the entities on the process, the latest start times are calculated using the time zone of the entity that is running the first operation of the process. All downstream entities are assumed to have the same time zone.