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 (Including Private)

Method Inventory (Including Private)

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 %Context as Ens.BP.Context [ Private , Calculated ];
This holds a reference to the context
Property methods: %ContextGet()
property %HandlerStack;
This holds the callstack for faulthanders
Property methods: %HandlerStackDisplayToLogical(), %HandlerStackGet(), %HandlerStackGetStored(), %HandlerStackIsValid(), %HandlerStackLogicalToDisplay(), %HandlerStackLogicalToOdbc(), %HandlerStackNormalize(), %HandlerStackSet()
property %NextState as %String [ Private , Final , InitialExpression = "S1" ];
This holds the next state of the thread
Property methods: %NextStateDisplayToLogical(), %NextStateGet(), %NextStateGetStored(), %NextStateIsValid(), %NextStateLogicalToDisplay(), %NextStateLogicalToOdbc(), %NextStateNormalize(), %NextStateSet()
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 %Process as Ens.BusinessProcess [ Private ];
This holds a reference to the process
Property methods: %ProcessExists(), %ProcessGet(), %ProcessGetObject(), %ProcessGetObjectId(), %ProcessGetStored(), %ProcessGetSwizzled(), %ProcessIsValid(), %ProcessNewObject(), %ProcessSet(), %ProcessSetObject(), %ProcessSetObjectId(), %ProcessUnSwizzle()
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()
property %Wait as %Boolean [ Private , Final , InitialExpression = 0 , Transient ];
Set this property to 1 to suspend this thread and to allow other threads to run
Property methods: %WaitDisplayToLogical(), %WaitGet(), %WaitIsValid(), %WaitLogicalToDisplay(), %WaitNormalize(), %WaitSet()

Methods

method %ContextGet() as Ens.BP.Context [ Language = objectscript ]
Accessor for the %Context property
private method %OnNew(initvalue As %RawString) as %Status [ Language = objectscript ]
This initializes the thread with the owning process
method AnyHandlerActive(ByRef pActive As %Boolean) as %Status [ Language = objectscript ]
Does this thread or any of its children have a fault handler active?
method EnterActivity(pActivity As %Integer, pSubActivity As %Integer, pActivityID As %Integer) [ Language = objectscript ]
This is invoked when a thread enters an activity
method Fault(pFault As %String) as %Boolean [ Language = objectscript ]
method GoSub(pGoSubState As %String, pReturnState As %String) as %Status [ Language = objectscript ]
This is invoked by a compensate activity when it wants to call a compensation handler
method IsResponsePending(pCompletionKey As %String) as %Boolean [ Language = objectscript ]
Determine if a CompletionKey exists in this threads pending responses
method LeaveActivity(pActivity As %Integer, pSubActivity As %Integer, pActivityID As %Integer) [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
method Return() as %Status [ Language = objectscript ]
This is invoked by a compensation handler when it wants to return to the caller
method SatisfyPendingResponses() [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
Synchronize threads
method UnwindActivities() [ Language = objectscript ]
This is invoked when control is transferred to a fault handler
method UpdateSynchronizedResponses() as %Status [ Language = objectscript ]
Update the Synchronized Response array

Indices

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 (Including Private)

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

Feedback