Home > Class Reference > ENSLIB namespace > Ens.BP.Thread
Private  Storage   


persistent class Ens.BP.Thread extends %Persistent

This class represents a thread of control with a business process


Parameters Properties Methods Queries Indices ForeignKeys Triggers
15 20 1


%ActivityStack %ChildThreads %HandlerStack %PendingAlarmHandle
%PendingResponses %PendingTimeout %Status %SubroutineStack
%SyncName %SyncResponses %SyncTimedOut

%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %ContextGet %Delete %DeleteExtent
%DeleteId %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Exists %ExistsId %Extends %GUID
%GUIDSet %GetLock %GetParameter %GetSwizzleObject
%Id %InsertBatch %IsA %IsModified
%IsNull %KillExtent %KillExtentData %LoadFromMemory
%LockExtent %LockId %New %NormalizeObject
%ObjectIsNull %ObjectModified %Oid %OnBeforeAddToSync
%OnDetermineClass %Open %OpenId %OriginalNamespace
%PackageName %PhysicalAddress %PurgeIndices %Reload
%RemoveFromSaveSet %ResolveConcurrencyConflict %RollBack %Save
%SaveDirect %SaveIndices %SerializeObject %SetModified
%SortBegin %SortEnd %SyncObjectIn %SyncTransport
%UnlockExtent %UnlockId %ValidateIndices %ValidateObject
AnyHandlerActive EnterActivity Fault GoSub
IsResponsePending LeaveActivity MakeAsyncCall MakeSyncCall
ManageStatus Return SatisfyPendingResponses StartThread
SwitchState SyncThreads UnwindActivities UpdateSynchronizedResponses

EnsLib.Printing.Dispatcher.Thread1 EnsLib.PushNotifications.IdentityManager.Process.Thread1 EnsLib.ebXML.Process.MessageReceiver.Thread1


• property %ActivityStack ;
This holds the activitystack for locating an activity at runtime
• property %ChildThreads as array of %String [ SqlFieldName = _ChildThreads ];
This holds the (possibly empty) set of child threads that this process is waiting on
• property %HandlerStack ;
This holds the callstack for faulthanders
• property %PendingAlarmHandle as %String;
This holds the handle the pending alarm request
• property %PendingResponses as array of %String [ SqlFieldName = _PendingResponses ];
This holds a collection of pending responses that this thread is waiting for
• property %PendingTimeout as %String;
This holds the name of the pending timeout call
• property %Status as Ens.DataType.RunStatus [ InitialExpression = $$$eRunStatusRunning ];
This holds the run status of this machine
• property %SubroutineStack as %String;
This holds the callstack for compensation handlers
• property %SyncName as %String;
This holds the name attribute of the tag
• property %SyncResponses as array of %Library.Persistent [ SqlFieldName = _SyncResponses ];
This holds a collection of responses that this thread has received
• property %SyncTimedOut as %Integer [ InitialExpression = 0 ];
This holds the timeout status of the most recent call and may be 0, 1 or 2 0 - The call did not timeout 1 - The call timed out 2 - The call was interrupted


• method %ContextGet() as Ens.BP.Context
Accessor for the %Context property
• method AnyHandlerActive(ByRef pActive As %Boolean) as %Status
Does this thread or any of its children have a fault handler active?
• method EnterActivity(pActivity As %Integer, pSubActivity As %Integer, pActivityID As %Integer)
This is invoked when a thread enters an activity
• method Fault(pFault As %String) as %Boolean
• method GoSub(pGoSubState As %String, pReturnState As %String) as %Status
This is invoked by a compensate activity when it wants to call a compensation handler
• method IsResponsePending(pCompletionKey As %String) as %Boolean
Determine if a CompletionKey exists in this threads pending responses
• method LeaveActivity(pActivity As %Integer, pSubActivity As %Integer, pActivityID As %Integer)
This is invoked when a thread leaves an activity
• method MakeAsyncCall(pResponseHandlerName As %String, pClassName As %String, pRequest As %Library.Persistent, pCompletionKey As %String, pResponseRequired As %Boolean, pIsTimer As %Boolean = 0, pDescription As %String = "", pSimSync As %Boolean = 0) as %Status
Make an Asynchronous call to the specified class, if a non-empty response handler is specified, that response handler will be called when the response is received
• method MakeSyncCall(pResponseHandlerName As %String, pClassName As %String, request As %Library.Persistent, response As %Library.Persistent, callrequest As %Library.Persistent, pDescription As %String = "") as %Status
Make a synchronous call to the specified class. If a non-empty response handler is specified, the response handler is called inline
• method ManageStatus(pStatus As %Status, pMethodName As %String) as %Status
• method Return() as %Status
This is invoked by a compensation handler when it wants to return to the caller
• method SatisfyPendingResponses()
This is invoked when a for 'any' is satisfied. The remaining pending responses need to removed from the master pending response list of the process. This ensures that delayed responses from a prior calls donot interfere with the current .
• method StartThread(pThreadClass As %String) as %Status
Start Thread, creates a new instance of the specified thread class, stores it's Id in the collection of child threads. Consequently the thread becomes runnable at the next state switch
• method SwitchState(Output pStatus As Ens.DataType.RunStatus, request As %Library.Persistent, response As %Library.Persistent, pCompletionKey As %String, pResumingPostErroredResponse As %Boolean) as %Status
Run the thread by handling responses,executing child threads, and calling the method indicated by the NextState property.
• method SyncThreads(Output pComplete As %Boolean) as %Status
Synchronize threads
• method UnwindActivities()
This is invoked when control is transferred to a fault handler
• method UpdateSynchronizedResponses() as %Status
Update the Synchronized Response array


•index (%Process on %Process);