Skip to main content

Ens.BP.Thread

persistent class Ens.BP.Thread extends %Library.Persistent

SQL Table Name: Ens_BP.Thread

This class represents a thread of control with a business process

Property Inventory

Method Inventory

Properties

property %ActivityStack;
This holds the activitystack for locating an activity at runtime
Property methods: %ActivityStackDisplayToLogical(), %ActivityStackGet(), %ActivityStackGetStored(), %ActivityStackIsValid(), %ActivityStackLogicalToDisplay(), %ActivityStackLogicalToOdbc(), %ActivityStackNormalize(), %ActivityStackSet()
property %ChildThreads as array of %String [ SqlFieldName = _ChildThreads ];
This holds the (possibly empty) set of child threads that this process is waiting on
Property methods: %ChildThreadsBuildValueArray(), %ChildThreadsCollectionToDisplay(), %ChildThreadsCollectionToOdbc(), %ChildThreadsDisplayToCollection(), %ChildThreadsDisplayToLogical(), %ChildThreadsGet(), %ChildThreadsGetObject(), %ChildThreadsGetObjectId(), %ChildThreadsGetStored(), %ChildThreadsGetSwizzled(), %ChildThreadsIsValid(), %ChildThreadsLogicalToDisplay(), %ChildThreadsLogicalToOdbc(), %ChildThreadsNormalize(), %ChildThreadsOdbcToCollection(), %ChildThreadsSet(), %ChildThreadsSetObject(), %ChildThreadsSetObjectId()
property %HandlerStack;
This holds the callstack for faulthanders
Property methods: %HandlerStackDisplayToLogical(), %HandlerStackGet(), %HandlerStackGetStored(), %HandlerStackIsValid(), %HandlerStackLogicalToDisplay(), %HandlerStackLogicalToOdbc(), %HandlerStackNormalize(), %HandlerStackSet()
property %PendingAlarmHandle as %String;
This holds the handle the pending alarm request
Property methods: %PendingAlarmHandleDisplayToLogical(), %PendingAlarmHandleGet(), %PendingAlarmHandleGetStored(), %PendingAlarmHandleIsValid(), %PendingAlarmHandleLogicalToDisplay(), %PendingAlarmHandleLogicalToOdbc(), %PendingAlarmHandleNormalize(), %PendingAlarmHandleSet()
property %PendingResponses as array of %String [ SqlFieldName = _PendingResponses ];
This holds a collection of pending responses that this thread is waiting for
Property methods: %PendingResponsesBuildValueArray(), %PendingResponsesCollectionToDisplay(), %PendingResponsesCollectionToOdbc(), %PendingResponsesDisplayToCollection(), %PendingResponsesDisplayToLogical(), %PendingResponsesGet(), %PendingResponsesGetObject(), %PendingResponsesGetObjectId(), %PendingResponsesGetStored(), %PendingResponsesGetSwizzled(), %PendingResponsesIsValid(), %PendingResponsesLogicalToDisplay(), %PendingResponsesLogicalToOdbc(), %PendingResponsesNormalize(), %PendingResponsesOdbcToCollection(), %PendingResponsesSet(), %PendingResponsesSetObject(), %PendingResponsesSetObjectId()
property %PendingTimeout as %String;
This holds the name of the pending timeout call
Property methods: %PendingTimeoutDisplayToLogical(), %PendingTimeoutGet(), %PendingTimeoutGetStored(), %PendingTimeoutIsValid(), %PendingTimeoutLogicalToDisplay(), %PendingTimeoutLogicalToOdbc(), %PendingTimeoutNormalize(), %PendingTimeoutSet()
property %Status as Ens.DataType.RunStatus [ InitialExpression = $$$eRunStatusRunning ];
This holds the run status of this machine
Property methods: %StatusDisplayToLogical(), %StatusGet(), %StatusGetStored(), %StatusIsValid(), %StatusLogicalToDisplay(), %StatusNormalize(), %StatusSet()
property %SubroutineStack as %String;
This holds the callstack for compensation handlers
Property methods: %SubroutineStackDisplayToLogical(), %SubroutineStackGet(), %SubroutineStackGetStored(), %SubroutineStackIsValid(), %SubroutineStackLogicalToDisplay(), %SubroutineStackLogicalToOdbc(), %SubroutineStackNormalize(), %SubroutineStackSet()
property %SyncName as %String;
This holds the name attribute of the tag
Property methods: %SyncNameDisplayToLogical(), %SyncNameGet(), %SyncNameGetStored(), %SyncNameIsValid(), %SyncNameLogicalToDisplay(), %SyncNameLogicalToOdbc(), %SyncNameNormalize(), %SyncNameSet()
property %SyncResponses as %Library.ArrayOfObjectsWithClassName [ SqlFieldName = _SyncResponses ];
This holds a collection of responses that this thread has received. The thread instance will be saved and be opened later. The contents of %SyncResponses are saved message body objects passed from Ens.BusinessProcess MessageHeaderHandler to the Process' OnResponse
Property methods: %SyncResponsesGet(), %SyncResponsesGetObject(), %SyncResponsesGetObjectId(), %SyncResponsesGetStored(), %SyncResponsesGetSwizzled(), %SyncResponsesIsEmpty(), %SyncResponsesIsValid(), %SyncResponsesNewObject(), %SyncResponsesSet(), %SyncResponsesSetObject(), %SyncResponsesSetObjectId(), %SyncResponsesUnSwizzle()
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
Property methods: %SyncTimedOutDisplayToLogical(), %SyncTimedOutGet(), %SyncTimedOutGetStored(), %SyncTimedOutIsValid(), %SyncTimedOutLogicalToDisplay(), %SyncTimedOutNormalize(), %SyncTimedOutSet()

Methods

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, callresponse As %Library.Persistent) 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

Indexes

index (%Process on %Process);
Index methods: %ProcessExists(), %ProcessGet(), %ProcessGetObject(), %ProcessGetObjectId(), %ProcessGetStored(), %ProcessGetSwizzled(), %ProcessIsValid(), %ProcessNewObject(), %ProcessSet(), %ProcessSetObject(), %ProcessSetObjectId(), %ProcessUnSwizzle()
index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods

Storage

Storage Model: Storage (Ens.BP.Thread)

^Ens.BP.ThreadD(ID,"%ChildThreads",n)
=
%ChildThreads(n)

Storage Model: Storage (Ens.BP.Thread)

^Ens.BP.ThreadD(ID,"%PendingResponses",n)
=
%PendingResponses(n)

Storage Model: Storage (Ens.BP.Thread)

^Ens.BP.ThreadD(ID,"%SyncResponses",n)
=
%SyncResponses(n)

Storage Model: Storage (Ens.BP.Thread)

^Ens.BP.ThreadD(ID)
=
%%CLASSNAME
%NextState
%Process
%Status
%SyncTimedOut
%PendingTimeout
%CallStack
%SubroutineStack
%FaultHandler
%FaultHandlerStack
%HandlerStack
%ActivityStack
%PendingAlarmHandle
%SyncName
%LastFault

Subclasses

FeedbackOpens in a new tab