Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jbpm.workflow.execution.impl
Class ExecutionContextImpl  view ExecutionContextImpl download ExecutionContextImpl.java

java.lang.Object
  extended byorg.jbpm.workflow.execution.impl.ExecutionContextImpl
All Implemented Interfaces:
org.jbpm.workflow.delegation.ActionContext, org.jbpm.workflow.delegation.AssignmentContext, org.jbpm.workflow.delegation.DecisionContext, org.jbpm.workflow.delegation.ForkContext, org.jbpm.workflow.delegation.HandlerContext, org.jbpm.workflow.delegation.JoinContext, org.jbpm.workflow.delegation.ProcessInvocationContext, org.jbpm.workflow.delegation.TaskContext

public class ExecutionContextImpl
extends java.lang.Object
implements org.jbpm.workflow.delegation.AssignmentContext, org.jbpm.workflow.delegation.DecisionContext, org.jbpm.workflow.delegation.ForkContext, org.jbpm.workflow.delegation.ActionContext, org.jbpm.workflow.delegation.JoinContext, org.jbpm.workflow.delegation.ProcessInvocationContext, org.jbpm.workflow.delegation.TaskContext


Field Summary
private  java.lang.String actorId
           
private  java.util.Collection assignedFlows
           
private  java.util.Map configuration
           
private  org.jbpm.util.db.DbSession dbSession
           
private  FlowImpl flow
           
private  java.util.Collection forkedFlows
           
private  org.jbpm.workflow.delegation.ActionContext invokedProcessContext
           
private  org.jbpm.workflow.log.impl.LogImpl log
           
private  org.jbpm.workflow.definition.impl.NodeImpl node
           
private  org.jbpm.workflow.organisation.OrganisationComponent organisationComponent
           
private  java.lang.String previousActorId
           
private  org.jbpm.workflow.definition.impl.ProcessDefinitionImpl processDefinition
           
private  ProcessInstanceImpl processInstance
           
private static java.lang.String queryFindAttributeInstanceByName
           
private static java.lang.String queryFindConcurrentFlows
           
private static java.lang.String queryFindLeavingTransitionByName
           
private static java.lang.String queryFindTransitionByName
           
 
Constructor Summary
ExecutionContextImpl()
          the default constructor is necessary for the ActorExpressionTest.
ExecutionContextImpl(java.lang.String actorId, org.jbpm.util.db.DbSession dbSession, org.jbpm.workflow.organisation.OrganisationComponent organisationComponent)
           
ExecutionContextImpl(java.lang.String actorId, FlowImpl flow, org.jbpm.util.db.DbSession dbSession, org.jbpm.workflow.organisation.OrganisationComponent organisationComponent)
           
ExecutionContextImpl(java.lang.String actorId, ProcessInstanceImpl processInstance, org.jbpm.util.db.DbSession dbSession, org.jbpm.workflow.organisation.OrganisationComponent organisationComponent)
           
 
Method Summary
 void addLogDetail(org.jbpm.workflow.log.impl.LogDetailImpl logDetail)
           
 void createLog(org.jbpm.workflow.definition.EventType eventType)
           
 void createLog(java.lang.String actorId, org.jbpm.workflow.definition.EventType eventType)
           
private  AttributeInstanceImpl findAttributeInstanceInScope(java.lang.String attributeName)
           
 void forkFlow(java.lang.String transitionName)
           
 void forkFlow(java.lang.String transitionName, java.util.Map attributeValues)
           
 void forkFlow(org.jbpm.workflow.definition.impl.TransitionImpl transition, java.util.Map attributeValues)
           
 org.jbpm.workflow.organisation.Actor getActor()
           
 java.lang.String getActorId()
           
 java.util.Collection getAssignedFlows()
           
 java.lang.Object getAttribute(java.lang.String name)
          gets the value of an org.jbpm.workflow.execution.AttributeInstance associated with this org.jbpm.workflow.execution.ProcessInstance.
 java.util.Map getConfiguration()
          gets the configuration, specified with the 'parameter'-tags in the process archive.
 org.jbpm.util.db.DbSession getDbSession()
           
private  java.util.Map getFieldsAndCheckRequired(java.util.Map attributeValues, org.jbpm.workflow.definition.impl.StateImpl state)
           
 org.jbpm.workflow.execution.Flow getFlow()
          gets the org.jbpm.workflow.execution.Flow in which the org.jbpm.workflow.definition.Action is executed.
 java.util.Collection getForkedFlows()
           
 org.jbpm.workflow.delegation.ActionContext getInvokedProcessContext()
          gets the ActionContext for the invoked process instance;
 org.jbpm.workflow.log.impl.LogImpl getLog()
           
 org.jbpm.workflow.definition.Node getNode()
          gets the org.jbpm.workflow.definition.ActivityState for which an org.jbpm.workflow.organisation.Actor has to be selected.
 org.jbpm.workflow.organisation.OrganisationComponent getOrganisationComponent()
          since Assigner-implementations tend to use the organisation-component this is a convenient way to get it.
 java.util.Collection getOtherActiveConcurrentFlows()
          gets all active concurrent flows other then the one that is actually arriving in the join.
 org.jbpm.workflow.organisation.Actor getPreviousActor()
          gets the org.jbpm.workflow.organisation.Actor that performed the previous activity-state.
 java.lang.String getPreviousActorId()
           
 org.jbpm.workflow.definition.ProcessDefinition getProcessDefinition()
          gets the org.jbpm.workflow.definition.ProcessDefinition.
 org.jbpm.workflow.execution.ProcessInstance getProcessInstance()
          gets the org.jbpm.workflow.execution.ProcessInstance.
(package private)  org.jbpm.workflow.definition.impl.TransitionImpl getTransition(java.lang.String transitionName, org.jbpm.workflow.definition.impl.StateImpl state, org.jbpm.util.db.DbSession dbSession)
           
 void log(java.lang.String msg)
          allows the Delegate-implementations to log events to the database.
 void schedule(org.jbpm.workflow.scheduler.Job job)
          convenience method for scheduling jobs
 void schedule(org.jbpm.workflow.scheduler.Job job, java.lang.String reference)
          convenience method for scheduling jobs
 void setActorAsPrevious()
           
 void setAssignedFlows(java.util.Collection assignedFlows)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
          sets the org.jbpm.workflow.execution.AttributeInstance for the attribute with name attributeName to the value attributeValue.
 void setConfiguration(java.util.Map configuration)
           
 void setFlow(org.jbpm.workflow.execution.Flow flow)
           
 void setForkedFlows(java.util.Collection createdSubFlows)
           
 void setInvokedProcessContext(org.jbpm.workflow.delegation.ActionContext invokedProcessContext)
           
 void setLog(org.jbpm.workflow.log.impl.LogImpl log)
           
 void setNode(org.jbpm.workflow.definition.Node node)
           
 void setProcessDefinition(org.jbpm.workflow.definition.ProcessDefinition processDefinition)
           
 void setProcessInstance(org.jbpm.workflow.execution.ProcessInstance processInstance)
           
 void storeAttributeValues(java.util.Map attributeValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryFindAttributeInstanceByName

private static final java.lang.String queryFindAttributeInstanceByName
See Also:
Constant Field Values

queryFindLeavingTransitionByName

private static final java.lang.String queryFindLeavingTransitionByName
See Also:
Constant Field Values

queryFindConcurrentFlows

private static final java.lang.String queryFindConcurrentFlows
See Also:
Constant Field Values

queryFindTransitionByName

private static final java.lang.String queryFindTransitionByName
See Also:
Constant Field Values

dbSession

private org.jbpm.util.db.DbSession dbSession

organisationComponent

private org.jbpm.workflow.organisation.OrganisationComponent organisationComponent

actorId

private java.lang.String actorId

previousActorId

private java.lang.String previousActorId

processDefinition

private org.jbpm.workflow.definition.impl.ProcessDefinitionImpl processDefinition

processInstance

private ProcessInstanceImpl processInstance

flow

private FlowImpl flow

node

private org.jbpm.workflow.definition.impl.NodeImpl node

log

private org.jbpm.workflow.log.impl.LogImpl log

configuration

private java.util.Map configuration

invokedProcessContext

private org.jbpm.workflow.delegation.ActionContext invokedProcessContext

assignedFlows

private java.util.Collection assignedFlows

forkedFlows

private java.util.Collection forkedFlows
Constructor Detail

ExecutionContextImpl

public ExecutionContextImpl()
the default constructor is necessary for the ActorExpressionTest.


ExecutionContextImpl

public ExecutionContextImpl(java.lang.String actorId,
                            org.jbpm.util.db.DbSession dbSession,
                            org.jbpm.workflow.organisation.OrganisationComponent organisationComponent)

ExecutionContextImpl

public ExecutionContextImpl(java.lang.String actorId,
                            FlowImpl flow,
                            org.jbpm.util.db.DbSession dbSession,
                            org.jbpm.workflow.organisation.OrganisationComponent organisationComponent)

ExecutionContextImpl

public ExecutionContextImpl(java.lang.String actorId,
                            ProcessInstanceImpl processInstance,
                            org.jbpm.util.db.DbSession dbSession,
                            org.jbpm.workflow.organisation.OrganisationComponent organisationComponent)
Method Detail

getDbSession

public org.jbpm.util.db.DbSession getDbSession()

getOrganisationComponent

public org.jbpm.workflow.organisation.OrganisationComponent getOrganisationComponent()
Description copied from interface: org.jbpm.workflow.delegation.AssignmentContext
since Assigner-implementations tend to use the organisation-component this is a convenient way to get it.

Specified by:
getOrganisationComponent in interface org.jbpm.workflow.delegation.AssignmentContext

getActorId

public java.lang.String getActorId()

getActor

public org.jbpm.workflow.organisation.Actor getActor()

setActorAsPrevious

public void setActorAsPrevious()

getPreviousActorId

public java.lang.String getPreviousActorId()

getPreviousActor

public org.jbpm.workflow.organisation.Actor getPreviousActor()
Description copied from interface: org.jbpm.workflow.delegation.AssignmentContext
gets the org.jbpm.workflow.organisation.Actor that performed the previous activity-state.

Specified by:
getPreviousActor in interface org.jbpm.workflow.delegation.AssignmentContext

getProcessDefinition

public org.jbpm.workflow.definition.ProcessDefinition getProcessDefinition()
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
gets the org.jbpm.workflow.definition.ProcessDefinition.

Specified by:
getProcessDefinition in interface org.jbpm.workflow.delegation.HandlerContext

setProcessDefinition

public void setProcessDefinition(org.jbpm.workflow.definition.ProcessDefinition processDefinition)

getProcessInstance

public org.jbpm.workflow.execution.ProcessInstance getProcessInstance()
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
gets the org.jbpm.workflow.execution.ProcessInstance.

Specified by:
getProcessInstance in interface org.jbpm.workflow.delegation.HandlerContext

setProcessInstance

public void setProcessInstance(org.jbpm.workflow.execution.ProcessInstance processInstance)

getFlow

public org.jbpm.workflow.execution.Flow getFlow()
Description copied from interface: org.jbpm.workflow.delegation.ActionContext
gets the org.jbpm.workflow.execution.Flow in which the Action is executed.

Specified by:
getFlow in interface org.jbpm.workflow.delegation.HandlerContext

setFlow

public void setFlow(org.jbpm.workflow.execution.Flow flow)

getNode

public org.jbpm.workflow.definition.Node getNode()
Description copied from interface: org.jbpm.workflow.delegation.AssignmentContext
gets the org.jbpm.workflow.definition.ActivityState for which an org.jbpm.workflow.organisation.Actor has to be selected.

Specified by:
getNode in interface org.jbpm.workflow.delegation.AssignmentContext

setNode

public void setNode(org.jbpm.workflow.definition.Node node)

getLog

public org.jbpm.workflow.log.impl.LogImpl getLog()

setLog

public void setLog(org.jbpm.workflow.log.impl.LogImpl log)

getConfiguration

public java.util.Map getConfiguration()
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
gets the configuration, specified with the 'parameter'-tags in the process archive.

Specified by:
getConfiguration in interface org.jbpm.workflow.delegation.HandlerContext

setConfiguration

public void setConfiguration(java.util.Map configuration)

getInvokedProcessContext

public org.jbpm.workflow.delegation.ActionContext getInvokedProcessContext()
Description copied from interface: org.jbpm.workflow.delegation.ProcessInvocationContext
gets the ActionContext for the invoked process instance;

Specified by:
getInvokedProcessContext in interface org.jbpm.workflow.delegation.ProcessInvocationContext

setInvokedProcessContext

public void setInvokedProcessContext(org.jbpm.workflow.delegation.ActionContext invokedProcessContext)

getAssignedFlows

public java.util.Collection getAssignedFlows()

setAssignedFlows

public void setAssignedFlows(java.util.Collection assignedFlows)

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
gets the value of an org.jbpm.workflow.execution.AttributeInstance associated with this org.jbpm.workflow.execution.ProcessInstance.

Specified by:
getAttribute in interface org.jbpm.workflow.delegation.HandlerContext

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Description copied from interface: org.jbpm.workflow.delegation.ActionContext
sets the org.jbpm.workflow.execution.AttributeInstance for the attribute with name attributeName to the value attributeValue.

Specified by:
setAttribute in interface org.jbpm.workflow.delegation.ActionContext

findAttributeInstanceInScope

private AttributeInstanceImpl findAttributeInstanceInScope(java.lang.String attributeName)

log

public void log(java.lang.String msg)
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
allows the Delegate-implementations to log events to the database.

Specified by:
log in interface org.jbpm.workflow.delegation.HandlerContext

createLog

public void createLog(org.jbpm.workflow.definition.EventType eventType)

createLog

public void createLog(java.lang.String actorId,
                      org.jbpm.workflow.definition.EventType eventType)

addLogDetail

public void addLogDetail(org.jbpm.workflow.log.impl.LogDetailImpl logDetail)

schedule

public void schedule(org.jbpm.workflow.scheduler.Job job)
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
convenience method for scheduling jobs

Specified by:
schedule in interface org.jbpm.workflow.delegation.HandlerContext

schedule

public void schedule(org.jbpm.workflow.scheduler.Job job,
                     java.lang.String reference)
Description copied from interface: org.jbpm.workflow.delegation.HandlerContext
convenience method for scheduling jobs

Specified by:
schedule in interface org.jbpm.workflow.delegation.HandlerContext

getForkedFlows

public java.util.Collection getForkedFlows()

setForkedFlows

public void setForkedFlows(java.util.Collection createdSubFlows)

forkFlow

public void forkFlow(java.lang.String transitionName)
Specified by:
forkFlow in interface org.jbpm.workflow.delegation.ForkContext

forkFlow

public void forkFlow(java.lang.String transitionName,
                     java.util.Map attributeValues)
Specified by:
forkFlow in interface org.jbpm.workflow.delegation.ForkContext

forkFlow

public void forkFlow(org.jbpm.workflow.definition.impl.TransitionImpl transition,
                     java.util.Map attributeValues)

storeAttributeValues

public void storeAttributeValues(java.util.Map attributeValues)

getFieldsAndCheckRequired

private java.util.Map getFieldsAndCheckRequired(java.util.Map attributeValues,
                                                org.jbpm.workflow.definition.impl.StateImpl state)

getOtherActiveConcurrentFlows

public java.util.Collection getOtherActiveConcurrentFlows()
Description copied from interface: org.jbpm.workflow.delegation.JoinContext
gets all active concurrent flows other then the one that is actually arriving in the join.

Specified by:
getOtherActiveConcurrentFlows in interface org.jbpm.workflow.delegation.JoinContext

getTransition

org.jbpm.workflow.definition.impl.TransitionImpl getTransition(java.lang.String transitionName,
                                                               org.jbpm.workflow.definition.impl.StateImpl state,
                                                               org.jbpm.util.db.DbSession dbSession)