Customization with Windchill Queues
Windchill queues provide a means of scheduling lower priority work which can be run in the background. Many of the OOTB Windchill services create and use queues for lower priority work activities. These capabilities are available to user customizations also.
As part of ongoing efforts to make Windchill more secure and robust access control checks have been added to all public queue APIs. What this means for all future customizations (that use queues) is that all calls to the Queue Service must first either set Administrator, or bypass access control. Failure to do so will result in a not authorized exception being thrown.
Sample Code
The following code pattern should be followed when setting Administrator:
SessionContext previous = SessionContext.newContext();
try {
SessionHelper.manager.setAdministrator();
// make calls to Queue Service
}
finally {
SessionContext.setContext(previous);
}
The following code pattern should be followed when bypassing access control:
boolean previous = SessionServerHelper.manager.setAccessEnforce(false);
try {
// make calls to Queue Service
}
finally {
SessionServerHelper.manager.setAccessEnforced(previous);
}
Performance Impact of Large Serialized Queue Arguments
In Windchill, queue entry arguments are often stored as serialized Java objects in the database as BLOBs. If these objects are large, they can negatively affect system performance in the following ways:
Slower queue processing—Large BLOBs take longer to deserialize, delaying task execution.
Increased memory usage—Deserializing large objects consumes more heap space, leading to frequent garbage collection and potential memory issues.
UI and system performance degradation—Heavy queue processing can slow down UI rendering and overall system responsiveness.
Best Practices for Configuring Queue Entry Arguments
Keep queue arguments small—Ensure that the target size is under a few megabytes. This reduces memory overhead and improves processing efficiency.
Avoid passing large data directly—Do not serialize and pass large data structures such as Map, List, or custom objects. Large serialized objects can cause performance bottlenecks.
Use evolvable persistable objects—Model complex or large data as Windchill Evolvable Persistable objects. These objects are versioned, persistable and designed to evolve without breaking compatibility.
Pass object references instead of full objects—Use ObjectReference to refer to persistable objects. This keeps queue entries lightweight and allows data retrieval only when needed.
È stato utile?