org.apache.ode.bpel.runtime
Class ExtensionContextImpl

java.lang.Object
  extended by org.apache.ode.bpel.runtime.ExtensionContextImpl
All Implemented Interfaces:
java.io.Serializable, ExtensionContext

public class ExtensionContextImpl
extends java.lang.Object
implements ExtensionContext

Author:
Tammo van Lessen (University of Stuttgart)
See Also:
Serialized Form

Constructor Summary
ExtensionContextImpl(org.apache.ode.bpel.runtime.ActivityInfo activityInfo, ScopeFrame scopeFrame, BpelRuntimeContext context)
           
 
Method Summary
 void complete(java.lang.String cid)
          Marks the currently executed activity as successfully completed.
 void completeWithFault(java.lang.String cid, FaultException ex)
          Marks the currently executed activity as faulted.
 void completeWithFault(java.lang.String cid, java.lang.Throwable t)
          Marks the currently executed activity as faulted.
 java.lang.String getActivityName()
          Returns the name of the invoking activity.
 java.lang.String[] getCorrelationValues()
           
 java.lang.String getCorrelatorId()
           
 java.net.URI getDUDir()
          Returns the location of the deployment bundle of the executed process.
 BpelRuntimeContext getInternalInstance()
          Returns ODE's internal runtime instance.
 OActivity getOActivity()
          Returns the OActivity object.
 ParentScopeChannel getParentScopeChannel()
           
 org.w3c.dom.Node getPartData(org.w3c.dom.Element element, java.lang.String variable)
           
 PartnerLinkInstance getPartnerLinkInstance(OPartnerLink partnerLink)
          Get the partner link
 PartnerLinkInstance getPartnerLinkInstance(java.lang.String partnerLinkName)
          Get the partner link
 java.lang.Long getProcessId()
          Reads the current process instance id.
 OProcess getProcessModel()
          Get the Process Model
 ScopeFrame getScopeFrame()
           
 TerminationChannel getTerminationChannel()
           
 OPartnerLink getVisiblePartnerLink(java.lang.String partnerLinkName)
           
 OScope.Variable getVisibleVariable(java.lang.String varName)
           
 java.util.Map<java.lang.String,OScope.Variable> getVisibleVariables()
          Returns a list of variables visible in the current scope.
 boolean isPartnerLinkVisible(java.lang.String partnerLinkName)
          Check whether the partner link is visible in the current scope or not
 boolean isVariableVisible(java.lang.String varName)
          Returns whether a variable is visible in the current scope or not.
 void printToConsole(java.lang.String msg)
          Allows printing debug output to the console.
 java.lang.String readMessageProperty(OScope.Variable variable, OProcess.OProperty property)
          Read the value of a BPEL property.
 org.w3c.dom.Node readVariable(OScope.Variable variable)
          Read the value of a BPEL variable.
 org.w3c.dom.Node readVariable(java.lang.String variableName)
          Read the value of a BPEL variable.
 void sendEvent(ScopeEvent event)
           
 void setBpelRuntimeContext(BpelRuntimeContext context)
           
 void setCorrelationValues(java.lang.String[] values)
          Set correlation values in order to find a route
 void setCorrelatorId(java.lang.String correlatorId)
          Set Correlator value This should be set in LongRunning extensions in-order to receive the response
 void writeVariable(OScope.Variable variable, org.w3c.dom.Node value)
          Write the value into a BPEL variable.
 void writeVariable(java.lang.String variableName, org.w3c.dom.Node value)
          Write the value into a BPEL variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionContextImpl

public ExtensionContextImpl(org.apache.ode.bpel.runtime.ActivityInfo activityInfo,
                            ScopeFrame scopeFrame,
                            BpelRuntimeContext context)
Method Detail

setBpelRuntimeContext

public void setBpelRuntimeContext(BpelRuntimeContext context)

getProcessId

public java.lang.Long getProcessId()
Description copied from interface: ExtensionContext
Reads the current process instance id.

Specified by:
getProcessId in interface ExtensionContext
Returns:
instance id

getVisibleVariables

public java.util.Map<java.lang.String,OScope.Variable> getVisibleVariables()
                                                                    throws FaultException
Description copied from interface: ExtensionContext
Returns a list of variables visible in the current scope.

Specified by:
getVisibleVariables in interface ExtensionContext
Returns:
an unmodifiable list of visible variables.
Throws:
FaultException - FaultException

readMessageProperty

public java.lang.String readMessageProperty(OScope.Variable variable,
                                            OProcess.OProperty property)
                                     throws FaultException
Description copied from interface: ExtensionContext
Read the value of a BPEL property.

Specified by:
readMessageProperty in interface ExtensionContext
Parameters:
variable - variable containing property
property - property to read
Returns:
value of the property
Throws:
FaultException - FaultException

readVariable

public org.w3c.dom.Node readVariable(OScope.Variable variable)
                              throws FaultException
Description copied from interface: ExtensionContext
Read the value of a BPEL variable.

Specified by:
readVariable in interface ExtensionContext
Parameters:
variable - variable to read
Returns:
the value of the variable, wrapped in a Node
Throws:
FaultException - FaultException

writeVariable

public void writeVariable(java.lang.String variableName,
                          org.w3c.dom.Node value)
                   throws FaultException
Description copied from interface: ExtensionContext
Write the value into a BPEL variable.

Specified by:
writeVariable in interface ExtensionContext
Parameters:
variableName - variable to write
value - the value to be stored into the variable
Throws:
FaultException - FaultException

readVariable

public org.w3c.dom.Node readVariable(java.lang.String variableName)
                              throws FaultException
Description copied from interface: ExtensionContext
Read the value of a BPEL variable.

Specified by:
readVariable in interface ExtensionContext
Parameters:
variableName - variable to read
Returns:
the value of the variable, wrapped in a Node
Throws:
FaultException - FaultException

writeVariable

public void writeVariable(OScope.Variable variable,
                          org.w3c.dom.Node value)
                   throws FaultException
Description copied from interface: ExtensionContext
Write the value into a BPEL variable.

Specified by:
writeVariable in interface ExtensionContext
Parameters:
variable - variable to write
value - the value to be stored into the variable
Throws:
FaultException - FaultException

getVisibleVariable

public OScope.Variable getVisibleVariable(java.lang.String varName)

isVariableVisible

public boolean isVariableVisible(java.lang.String varName)
Description copied from interface: ExtensionContext
Returns whether a variable is visible in the current scope or not.

Specified by:
isVariableVisible in interface ExtensionContext
Parameters:
varName - name of the variable.
Returns:
true if the variable is visible.

getActivityName

public java.lang.String getActivityName()
Description copied from interface: ExtensionContext
Returns the name of the invoking activity.

Specified by:
getActivityName in interface ExtensionContext
Returns:
activity name

getOActivity

public OActivity getOActivity()
Description copied from interface: ExtensionContext
Returns the OActivity object.

Specified by:
getOActivity in interface ExtensionContext
Returns:
OActivity

sendEvent

public void sendEvent(ScopeEvent event)

complete

public void complete(java.lang.String cid)
Description copied from interface: ExtensionContext
Marks the currently executed activity as successfully completed.

Specified by:
complete in interface ExtensionContext
Parameters:
cid - id

completeWithFault

public void completeWithFault(java.lang.String cid,
                              java.lang.Throwable t)
Description copied from interface: ExtensionContext
Marks the currently executed activity as faulted.

Specified by:
completeWithFault in interface ExtensionContext
Parameters:
cid - id
t - an exception to be reported as the fault cause.

completeWithFault

public void completeWithFault(java.lang.String cid,
                              FaultException ex)
Description copied from interface: ExtensionContext
Marks the currently executed activity as faulted.

Specified by:
completeWithFault in interface ExtensionContext
Parameters:
cid - id
ex - a fault.

getInternalInstance

public BpelRuntimeContext getInternalInstance()
Description copied from interface: ExtensionContext
Returns ODE's internal runtime instance.

Specified by:
getInternalInstance in interface ExtensionContext
Returns:
OdeInternalInstance

getDUDir

public java.net.URI getDUDir()
Description copied from interface: ExtensionContext
Returns the location of the deployment bundle of the executed process.

Specified by:
getDUDir in interface ExtensionContext
Returns:
URI of the deployment bundle.

printToConsole

public void printToConsole(java.lang.String msg)
Description copied from interface: ExtensionContext
Allows printing debug output to the console. Output will be redirected to the logger associated with org.apache.ode.extension.Console. The target log level is INFO.

Specified by:
printToConsole in interface ExtensionContext
Parameters:
msg - Message

getPartnerLinkInstance

public PartnerLinkInstance getPartnerLinkInstance(java.lang.String partnerLinkName)
                                           throws FaultException
Description copied from interface: ExtensionContext
Get the partner link

Specified by:
getPartnerLinkInstance in interface ExtensionContext
Parameters:
partnerLinkName - name of the partner link
Returns:
PartnerLinkInstance
Throws:
FaultException - FaultException

getVisiblePartnerLink

public OPartnerLink getVisiblePartnerLink(java.lang.String partnerLinkName)

isPartnerLinkVisible

public boolean isPartnerLinkVisible(java.lang.String partnerLinkName)
Description copied from interface: ExtensionContext
Check whether the partner link is visible in the current scope or not

Specified by:
isPartnerLinkVisible in interface ExtensionContext
Parameters:
partnerLinkName - name of the partner link
Returns:
true if the partner link is visible

getPartnerLinkInstance

public PartnerLinkInstance getPartnerLinkInstance(OPartnerLink partnerLink)
                                           throws FaultException
Description copied from interface: ExtensionContext
Get the partner link

Specified by:
getPartnerLinkInstance in interface ExtensionContext
Parameters:
partnerLink - partnerLink
Returns:
PartnerLinkInstance
Throws:
FaultException - FaultException

getProcessModel

public OProcess getProcessModel()
Description copied from interface: ExtensionContext
Get the Process Model

Specified by:
getProcessModel in interface ExtensionContext
Returns:
ProcessModel

setCorrelationValues

public void setCorrelationValues(java.lang.String[] values)
Set correlation values in order to find a route

Specified by:
setCorrelationValues in interface ExtensionContext
Parameters:
values - values

getCorrelationValues

public java.lang.String[] getCorrelationValues()
Specified by:
getCorrelationValues in interface ExtensionContext

getCorrelatorId

public java.lang.String getCorrelatorId()
Specified by:
getCorrelatorId in interface ExtensionContext

setCorrelatorId

public void setCorrelatorId(java.lang.String correlatorId)
Description copied from interface: ExtensionContext
Set Correlator value This should be set in LongRunning extensions in-order to receive the response

Specified by:
setCorrelatorId in interface ExtensionContext
Parameters:
correlatorId - partnerlink.operation

getPartData

public org.w3c.dom.Node getPartData(org.w3c.dom.Element element,
                                    java.lang.String variable)
Specified by:
getPartData in interface ExtensionContext

getTerminationChannel

public TerminationChannel getTerminationChannel()
Specified by:
getTerminationChannel in interface ExtensionContext

getParentScopeChannel

public ParentScopeChannel getParentScopeChannel()
Specified by:
getParentScopeChannel in interface ExtensionContext

getScopeFrame

public ScopeFrame getScopeFrame()


Copyright © 2015 WSO2. All Rights Reserved.