org.apache.ode.bpel.runtime

## Interface BpelRuntimeContext

- All Known Implementing Classes:
    BpelRuntimeContextImpl, ReplayerBpelRuntimeContextImpl

      public interface BpelRuntimeContext

  A facade for accessing all the BPEL functionality that is not implemented directly in the JACOB framework, but rather "natively" . Things that are so implemented include variables (i.e. the JACOB state-space does not include dimensions for variables, these are instead implemented as database rows of some sort), the communication activities pick/receive/invoke (i.e. there are no JACOB channels representing partnerLink links), and correlation (i.e. the JACOB objects do not match message to process instances, this happens in this native layer).

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `BpelRuntimeContext.ValueReferencePair`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel(TimerResponseChannel timerResponseChannel)` Cancel a timer, or pick.
    `void` | `cancelOutstandingRequests(java.lang.String channelId)`
    `void` | `completedFault(FaultData faultData)` Should be invoked by process template, signalling process completion with fault.
    `void` | `completedOk()` Should be invoked by process template, signalling process completion with no faults.
    `org.w3c.dom.Node` | `convertEndpointReference(org.w3c.dom.Element epr, org.w3c.dom.Node targetNode)`
    `java.lang.Long` | `createScopeInstance(java.lang.Long parentScopeId, OScope scopeType)` Create a scope instance object.
    `org.w3c.dom.Element` | `fetchMyRoleEndpointReferenceData(PartnerLinkInstance pLink)` Fetches the my-role endpoint reference data.
    `java.lang.String` | `fetchMySessionId(PartnerLinkInstance pLink)` Fetches our session id associated with the partner link instance.
    `org.w3c.dom.Element` | `fetchPartnerRoleEndpointReferenceData(PartnerLinkInstance pLink)`
    `java.lang.String` | `fetchPartnersSessionId(PartnerLinkInstance pLink)` Fetches the partner's session id associated with the partner link instance.
    `long` | `genId()` Generate a unique (and monotonic) ID in the context of this instance.
    `java.net.URI` | `getBaseResourceURI()` Retrieves the base URI that this BPEL Process instance is running relative to.
    `ProcessConf.PartnerRoleConfig` | `getConfigForPartnerLink(OPartnerLink pLink)` Retrieve failure handling info for invoke
    `java.util.Date` | `getCurrentEventDateTime()`
    `ExpressionLanguageRuntimeRegistry` | `getExpLangRuntime()`
    `org.w3c.dom.Element` | `getMyRequest(java.lang.String mexId)`
    `javax.xml.namespace.QName` | `getPartnerFault(java.lang.String mexId)`
    `java.lang.String` | `getPartnerFaultExplanation(java.lang.String mexId)`
    `org.w3c.dom.Element` | `getPartnerResponse(java.lang.String mexId)`
    `javax.xml.namespace.QName` | `getPartnerResponseType(java.lang.String mexId)`
    `java.lang.Long` | `getPid()`
    `java.lang.ClassLoader` | `getProcessClassLoader()`
    `org.w3c.dom.Node` | `getProcessProperty(javax.xml.namespace.QName propertyName)` Retrieves the property value that has been defined for this BPEL Process type.
    `javax.xml.namespace.QName` | `getProcessQName()`
    `org.w3c.dom.Element` | `getSourceEPR(java.lang.String mexId)`
    `java.lang.String` | `getSourceSessionId(java.lang.String mexId)`
    `void` | `initializePartnerLinks(java.lang.Long parentScopeId, java.util.Collection<OPartnerLink> partnerLinks)` Initializes endpoint references for partner links inside a scope.
    `void` | `initializePartnersSessionId(PartnerLinkInstance pLink, java.lang.String session)` Initialize the partner's session id for this partner link instance.
    `java.lang.String` | `invoke(int activityId, PartnerLinkInstance partnerLinkInstance, javax.wsdl.Operation operation, org.w3c.dom.Element outboundMsg, InvokeResponseChannel invokeResponseChannel)` Called back when the process executes an invokation.
    `boolean` | `isCorrelationInitialized(CorrelationSetInstance cset)`
    `boolean` | `isPartnerRoleEndpointInitialized(PartnerLinkInstance pLink)` Determine if the partner role of an endpoint has been initialized (either explicitly throug assginment or via the deployment descriptor)
    `boolean` | `isVariableInitialized(VariableInstance variable)` Checks for variable initialization, i.e.
    `void` | `processOutstandingRequest(PartnerLinkInstance partnerLink, java.lang.String opName, java.lang.String bpelMexId, java.lang.String odeMexId)`
    `CorrelationKey` | `readCorrelation(CorrelationSetInstance cset)`
    `org.w3c.dom.Node` | `readExtVar(OScope.Variable variable, org.w3c.dom.Node reference)` Read an external variable.
    `java.lang.String` | `readProperty(VariableInstance var, OProcess.OProperty property)` Evaluate a property alias query expression against a variable, returning the normalized `String` representation of the property value.
    `org.w3c.dom.Node` | `readVariable(java.lang.Long scopeInstanceId, java.lang.String varname, boolean forWriting)`
    `void` | `recoverActivity(java.lang.String channel, long activityId, java.lang.String action, FaultData fault)`
    `void` | `registerActivityForRecovery(ActivityRecoveryChannel channel, long activityId, java.lang.String reason, java.util.Date dateTime, org.w3c.dom.Element details, java.lang.String[] actions, int retries)`
    `void` | `registerTimer(TimerResponseChannel timerChannel, java.util.Date timeToFire)` Registers a timer for future notification.
    `void` | `releasePartnerMex(java.lang.String mexId, boolean instanceSucceeded)`
    `void` | `reply(PartnerLinkInstance plink, java.lang.String opName, java.lang.String mexId, org.w3c.dom.Element msg, javax.xml.namespace.QName fault)` Send a reply to an open message-exchange.
    `void` | `select(PickResponseChannel response, java.util.Date timeout, boolean createInstnace, Selector[] selectors)` Non-deterministic selection on incoming message-exchanges.
    `void` | `sendEvent(ProcessInstanceEvent event)` Sends the bpel event.
    `void` | `terminate()` Terminates the process / sets state flag to terminate and ceases all processing on the VPU.
    `void` | `unregisterActivityForRecovery(ActivityRecoveryChannel channel)`
    `void` | `writeCorrelation(CorrelationSetInstance cset, CorrelationKey correlation)`
    `void` | `writeEndpointReference(PartnerLinkInstance variable, org.w3c.dom.Element data)` Writes a partner EPR.
    `BpelRuntimeContext.ValueReferencePair` | `writeExtVar(OScope.Variable variable, org.w3c.dom.Node reference, org.w3c.dom.Node value)` Write an external variable.
    `org.w3c.dom.Node` | `writeVariable(VariableInstance var, org.w3c.dom.Node changes)`

- - ### Method Detail

    - #### getPid

          java.lang.Long getPid()

    - #### isVariableInitialized

          boolean isVariableInitialized(VariableInstance variable)

      Checks for variable initialization, i.e. has had a 'write'
      Parameters:
        `variable` - variable
      Returns:
        `true` if initialized

    - #### createScopeInstance

          java.lang.Long createScopeInstance(java.lang.Long parentScopeId,
                                             OScope scopeType)

      Create a scope instance object.
      Parameters:
        `parentScopeId` - _id of parent scope (null if root scope)
        `scopeType` - the type of scope, i.e. the name of the scope
      Returns:
        scope instance identifier

    - #### initializePartnerLinks

          void initializePartnerLinks(java.lang.Long parentScopeId,
                                      java.util.Collection<OPartnerLink> partnerLinks)

      Initializes endpoint references for partner links inside a scope.
      Parameters:
        `parentScopeId` -
        `partnerLinks` -

    - #### readVariable

          org.w3c.dom.Node readVariable(java.lang.Long scopeInstanceId,
                                        java.lang.String varname,
                                        boolean forWriting)
                                 throws FaultException

      Parameters:
        `var` - variable to read
      Returns:
      Throws:
        `FaultException`

    - #### fetchMyRoleEndpointReferenceData

          org.w3c.dom.Element fetchMyRoleEndpointReferenceData(PartnerLinkInstance pLink)

      Fetches the my-role endpoint reference data.
      Parameters:
        `pLink` -
        `isMyEPR` -
      Returns:
      Throws:
        `FaultException`

    - #### fetchPartnerRoleEndpointReferenceData

          org.w3c.dom.Element fetchPartnerRoleEndpointReferenceData(PartnerLinkInstance pLink)
                                                             throws FaultException

      Throws:
        `FaultException`

    - #### isPartnerRoleEndpointInitialized

          boolean isPartnerRoleEndpointInitialized(PartnerLinkInstance pLink)

      Determine if the partner role of an endpoint has been initialized (either explicitly throug assginment or via the deployment descriptor)
      Parameters:
        `pLink` - partner link
      Returns:

    - #### getConfigForPartnerLink

          ProcessConf.PartnerRoleConfig getConfigForPartnerLink(OPartnerLink pLink)

      Retrieve failure handling info for invoke
      Parameters:
        `pLink` -
      Returns:

    - #### fetchMySessionId

          java.lang.String fetchMySessionId(PartnerLinkInstance pLink)

      Fetches our session id associated with the partner link instance. This will always return a non-null value.
      Parameters:
        `pLink` - partner link

    - #### fetchPartnersSessionId

          java.lang.String fetchPartnersSessionId(PartnerLinkInstance pLink)

      Fetches the partner's session id associated with the partner link instance.
      Parameters:
        `pLink` - partner link

    - #### initializePartnersSessionId

          void initializePartnersSessionId(PartnerLinkInstance pLink,
                                           java.lang.String session)

      Initialize the partner's session id for this partner link instance.
      Parameters:
        `pLink` - partner link
        `session` - session identifier

    - #### readProperty

          java.lang.String readProperty(VariableInstance var,
                                        OProcess.OProperty property)
                                 throws FaultException

      Evaluate a property alias query expression against a variable, returning the normalized `String` representation of the property value.
      Parameters:
        `var` - variable to read
        `property` - property to read
      Returns:
        value of property for variable, in String form
      Throws:
        `FaultException` - in case of selection or other fault

    - #### writeEndpointReference

          void writeEndpointReference(PartnerLinkInstance variable,
                                      org.w3c.dom.Element data)
                               throws FaultException

      Writes a partner EPR.
      Parameters:
        `variable` -
        `data` -
      Throws:
        `FaultException`

    - #### convertEndpointReference

          org.w3c.dom.Node convertEndpointReference(org.w3c.dom.Element epr,
                                                    org.w3c.dom.Node targetNode)

    - #### writeVariable

          org.w3c.dom.Node writeVariable(VariableInstance var,
                                         org.w3c.dom.Node changes)

    - #### isCorrelationInitialized

          boolean isCorrelationInitialized(CorrelationSetInstance cset)

    - #### readCorrelation

          CorrelationKey readCorrelation(CorrelationSetInstance cset)

    - #### writeCorrelation

          void writeCorrelation(CorrelationSetInstance cset,
                                CorrelationKey correlation)

    - #### completedOk

          void completedOk()

      Should be invoked by process template, signalling process completion with no faults.

    - #### completedFault

          void completedFault(FaultData faultData)

      Should be invoked by process template, signalling process completion with fault.

    - #### select

          void select(PickResponseChannel response,
                      java.util.Date timeout,
                      boolean createInstnace,
                      Selector[] selectors)
               throws FaultException

      Non-deterministic selection on incoming message-exchanges.
      Throws:
        `FaultException`

    - #### cancel

          void cancel(TimerResponseChannel timerResponseChannel)

      Cancel a timer, or pick.
      Parameters:
        `timerResponseChannel` -

    - #### cancelOutstandingRequests

          void cancelOutstandingRequests(java.lang.String channelId)

    - #### reply

          void reply(PartnerLinkInstance plink,
                     java.lang.String opName,
                     java.lang.String mexId,
                     org.w3c.dom.Element msg,
                     javax.xml.namespace.QName fault)
              throws FaultException

      Send a reply to an open message-exchange.
      Parameters:
        `msg` - response message
        `fault` - fault name, if this is a fault reply, otherwise `null`
      Throws:
        `FaultException`

    - #### invoke

          java.lang.String invoke(int activityId,
                                  PartnerLinkInstance partnerLinkInstance,
                                  javax.wsdl.Operation operation,
                                  org.w3c.dom.Element outboundMsg,
                                  InvokeResponseChannel invokeResponseChannel)
                           throws FaultException

      Called back when the process executes an invokation.
      Parameters:
        `activityId` - The activity id in the process definition (id of OInvoke)
        `partnerLinkInstance` - The partner link variable instance
        `operation` - The wsdl operation.
        `outboundMsg` - The message sent outside as a DOM
        `invokeResponseChannel` - Object called back when the response is received.
      Returns:
        The instance id of the message exchange.
      Throws:
        `FaultException` - When the response is a fault or when the invoke could not be executed in which case it is one of the bpel standard fault.

    - #### registerTimer

          void registerTimer(TimerResponseChannel timerChannel,
                             java.util.Date timeToFire)

      Registers a timer for future notification.
      Parameters:
        `timerChannel` - channel for timer notification
        `timeToFire` - future time to fire timer notification

    - #### terminate

          void terminate()

      Terminates the process / sets state flag to terminate and ceases all processing on the VPU.

    - #### sendEvent

          void sendEvent(ProcessInstanceEvent event)

      Sends the bpel event.
      Parameters:
        `event` -

    - #### getExpLangRuntime

          ExpressionLanguageRuntimeRegistry getExpLangRuntime()

    - #### genId

          long genId()

      Generate a unique (and monotonic) ID in the context of this instance.
      Returns:

    - #### getPartnerResponse

          org.w3c.dom.Element getPartnerResponse(java.lang.String mexId)

    - #### getMyRequest

          org.w3c.dom.Element getMyRequest(java.lang.String mexId)

    - #### getPartnerFault

          javax.xml.namespace.QName getPartnerFault(java.lang.String mexId)

    - #### getPartnerFaultExplanation

          java.lang.String getPartnerFaultExplanation(java.lang.String mexId)

    - #### getPartnerResponseType

          javax.xml.namespace.QName getPartnerResponseType(java.lang.String mexId)

    - #### getSourceEPR

          org.w3c.dom.Element getSourceEPR(java.lang.String mexId)

    - #### registerActivityForRecovery

          void registerActivityForRecovery(ActivityRecoveryChannel channel,
                                           long activityId,
                                           java.lang.String reason,
                                           java.util.Date dateTime,
                                           org.w3c.dom.Element details,
                                           java.lang.String[] actions,
                                           int retries)

    - #### unregisterActivityForRecovery

          void unregisterActivityForRecovery(ActivityRecoveryChannel channel)

    - #### recoverActivity

          void recoverActivity(java.lang.String channel,
                               long activityId,
                               java.lang.String action,
                               FaultData fault)

    - #### getSourceSessionId

          java.lang.String getSourceSessionId(java.lang.String mexId)

    - #### releasePartnerMex

          void releasePartnerMex(java.lang.String mexId,
                                 boolean instanceSucceeded)

    - #### readExtVar

          org.w3c.dom.Node readExtVar(OScope.Variable variable,
                                      org.w3c.dom.Node reference)
                               throws ExternalVariableModuleException

      Read an external variable.
      Throws:
        `ExternalVariableModuleException`

    - #### writeExtVar

          BpelRuntimeContext.ValueReferencePair writeExtVar(OScope.Variable variable,
                                                            org.w3c.dom.Node reference,
                                                            org.w3c.dom.Node value)
                                                     throws ExternalVariableModuleException

      Write an external variable.
      Throws:
        `ExternalVariableModuleException`

    - #### getBaseResourceURI

          java.net.URI getBaseResourceURI()

      Retrieves the base URI that this BPEL Process instance is running relative to.
      Returns:
        URI - the URI representing the absolute physical file path location that this process is defined within.

    - #### getProcessProperty

          org.w3c.dom.Node getProcessProperty(javax.xml.namespace.QName propertyName)

      Retrieves the property value that has been defined for this BPEL Process type.
      Returns:
        propertyValue - the value corresponding to the process property name.

    - #### getProcessQName

          javax.xml.namespace.QName getProcessQName()

    - #### processOutstandingRequest

          void processOutstandingRequest(PartnerLinkInstance partnerLink,
                                         java.lang.String opName,
                                         java.lang.String bpelMexId,
                                         java.lang.String odeMexId)
                                  throws FaultException

      Throws:
        `FaultException`

    - #### getCurrentEventDateTime

          java.util.Date getCurrentEventDateTime()

    - #### getProcessClassLoader

          java.lang.ClassLoader getProcessClassLoader()