com.camunda.toolkit.jbpm.model
Class ProcessModel

java.lang.Object
  extended by com.camunda.toolkit.jbpm.model.ProcessModel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultProcessModel

public abstract class ProcessModel
extends java.lang.Object
implements java.io.Serializable

Abstract Superclass for all ProcessModel's in the client The process model is respsonsible for

  • make life a little bit easier for the developer of gui panels
  • provide some support for the developer of jbpm ActionHandlers

    Author:
    Bernd Rücker
    See Also:
    Serialized Form

    Constructor Summary
    ProcessModel(org.jbpm.graph.exe.ExecutionContext context)
               
    ProcessModel(org.jbpm.graph.def.ProcessDefinition process)
               
    ProcessModel(org.jbpm.graph.exe.ProcessInstance processInstance)
               
    ProcessModel(org.jbpm.taskmgmt.exe.TaskInstance taskInstance)
               
     
    Method Summary
     void addExceptionListener(com.camunda.commons.exception.ExceptionListener listener)
               
     void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
               
     void addRemarks()
               
     void addTransientVariable(java.lang.String name, java.lang.Object value)
               
     void addVariable(java.lang.String name, java.lang.Object value)
               
    protected  void addVariableChangeListener(java.lang.String variableName, com.camunda.commons.beans.BoundBean bean)
              add a property change listener to a BoundBean so if the Bean changes, the variable is added again to the Context (which is necessary when working with the ExecutionContext, because otherwise changes of the object will not be saved!)
     void cancel()
               
     void cancelWorkOnTask()
              cancel assignment of the actor so the task is putted back to the pool
     void clearCache()
              clear local cache of model
     void createBusinessObject(java.lang.Object delegate, java.lang.Object businessObject, java.lang.String keyVariableName)
               
     void createBusinessObject(java.lang.Object delegate, java.lang.String businessObjectVariableName, java.lang.String keyVariableName)
              save a business object into the business logic.
     void deleteVariable(java.lang.String name)
               
    protected  void fireExceptionOccured(java.lang.Throwable ex)
               
    protected  void firePropertyChange()
               
    protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
               
     com.camunda.scruffy.actions.GuiAction getActionForTransition(org.jbpm.graph.def.Transition transition, com.camunda.scruffy.components.GuiComponent form)
               
     java.awt.Component getCurrentAvailableActionButtonBar()
               
     java.awt.Component getCurrentAvailableActionButtonBar(com.camunda.scruffy.components.GuiComponent form)
               
     javax.swing.JMenu getCurrentAvailableActionMenu(com.camunda.scruffy.components.GuiComponent forForm)
              returns a JMenu Component containing items for all current active actions
     javax.swing.JPopupMenu getCurrentAvailableActionPopupMenu(com.camunda.scruffy.components.GuiComponent forForm)
              returns a JPopupMenu Component containing items for all current active actions
     com.camunda.scruffy.actions.GuiAction[] getCurrentAvailableActions(com.camunda.scruffy.components.GuiComponent form)
               
     java.lang.String getCurrentStateName()
               
     org.jbpm.graph.exe.ExecutionContext getExectuionContext()
               
     java.lang.Object getMainBoBean()
               
     org.jbpm.graph.exe.ProcessInstance getProcessInstance()
               
     java.lang.String getProcessName()
               
     java.lang.String getProcessRemarks()
              returns remarks for this process The remarks can be build up on all the process variables to form ONE string to have additional description in the gui
     long getRootTokenId()
               
     java.lang.String getRootTokenIdAsString()
               
     long getTaskId()
               
     java.lang.String getTaskIdAsString()
               
     org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance()
               
     long getTokenId()
               
     java.lang.String getTokenIdAsString()
               
     java.lang.Object getTransientVariable(java.lang.String name)
               
     java.lang.Object getVariable(java.lang.String name)
               
     boolean hasProcessEnded()
               
     boolean isActionsDeactivated()
               
     boolean isNewProcess()
               
     void loadAdditionalBusinessVariables()
              This method is called on the Server before the result is returned to the client So additioanl business variables can be loaded (in dependency of the process data for ecxample) overwrite to use that logic
    protected static org.apache.log4j.Logger log()
               
     void reload()
              Reload the Data in this model
     void removeExceptionListener(com.camunda.commons.exception.ExceptionListener listener)
               
     void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
               
     void saveBusinessObject(java.lang.Object delegate, java.lang.Object businessObject, java.lang.String keyVariableName, boolean create)
               
     void saveChangesOfAdditionalBusinessVariables(java.util.Map variables)
              This method is called on the Server before special command (signal, end-task) are executet.
     void setActionsDeactivated(boolean actionsDeactivated)
               
     void signal()
               
     void signal(java.lang.String transitionName)
              if we have a new process, this process is created and started, if we have a TaskInstance, the task is ended with the given transition, else we send a signal to the RootToken.
     void signal(org.jbpm.graph.def.Transition transition)
              if we have a new process, this process is created and started, if we have a TaskInstance, the task is ended with the given transition, else we send a signal to the RootToken.
     void startWithTask()
              assign the current working user as actor in the task to remove it from the pool
     void updateBusinessObject(java.lang.Object delegate, java.lang.Object businessObject, java.lang.String keyVariableName)
               
     void updateBusinessObject(java.lang.Object delegate, java.lang.String businessObjectVariableName, java.lang.String keyVariableName)
              update a business object into the business logic.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ProcessModel

    public ProcessModel(org.jbpm.graph.def.ProcessDefinition process)

    ProcessModel

    public ProcessModel(org.jbpm.taskmgmt.exe.TaskInstance taskInstance)

    ProcessModel

    public ProcessModel(org.jbpm.graph.exe.ProcessInstance processInstance)

    ProcessModel

    public ProcessModel(org.jbpm.graph.exe.ExecutionContext context)
    Method Detail

    log

    protected static org.apache.log4j.Logger log()

    getProcessName

    public java.lang.String getProcessName()

    setActionsDeactivated

    public void setActionsDeactivated(boolean actionsDeactivated)

    removeExceptionListener

    public void removeExceptionListener(com.camunda.commons.exception.ExceptionListener listener)

    addExceptionListener

    public void addExceptionListener(com.camunda.commons.exception.ExceptionListener listener)

    fireExceptionOccured

    protected void fireExceptionOccured(java.lang.Throwable ex)

    addPropertyChangeListener

    public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

    removePropertyChangeListener

    public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

    firePropertyChange

    protected void firePropertyChange()

    firePropertyChange

    protected void firePropertyChange(java.lang.String propertyName,
                                      java.lang.Object oldValue,
                                      java.lang.Object newValue)

    getRootTokenId

    public long getRootTokenId()

    getRootTokenIdAsString

    public java.lang.String getRootTokenIdAsString()

    getTaskId

    public long getTaskId()

    getTaskIdAsString

    public java.lang.String getTaskIdAsString()

    getTokenId

    public long getTokenId()

    getTokenIdAsString

    public java.lang.String getTokenIdAsString()

    isNewProcess

    public boolean isNewProcess()

    startWithTask

    public void startWithTask()
    assign the current working user as actor in the task to remove it from the pool


    cancelWorkOnTask

    public void cancelWorkOnTask()
    cancel assignment of the actor so the task is putted back to the pool


    cancel

    public void cancel()

    getCurrentStateName

    public java.lang.String getCurrentStateName()

    hasProcessEnded

    public boolean hasProcessEnded()

    getProcessRemarks

    public java.lang.String getProcessRemarks()
                                       throws java.lang.Exception
    returns remarks for this process The remarks can be build up on all the process variables to form ONE string to have additional description in the gui

    Throws:
    java.lang.Exception

    getVariable

    public java.lang.Object getVariable(java.lang.String name)

    addVariable

    public void addVariable(java.lang.String name,
                            java.lang.Object value)

    addTransientVariable

    public void addTransientVariable(java.lang.String name,
                                     java.lang.Object value)

    getTransientVariable

    public java.lang.Object getTransientVariable(java.lang.String name)

    deleteVariable

    public void deleteVariable(java.lang.String name)

    addVariableChangeListener

    protected void addVariableChangeListener(java.lang.String variableName,
                                             com.camunda.commons.beans.BoundBean bean)
    add a property change listener to a BoundBean so if the Bean changes, the variable is added again to the Context (which is necessary when working with the ExecutionContext, because otherwise changes of the object will not be saved!)

    Parameters:
    variableName -
    bean -

    getActionForTransition

    public com.camunda.scruffy.actions.GuiAction getActionForTransition(org.jbpm.graph.def.Transition transition,
                                                                        com.camunda.scruffy.components.GuiComponent form)

    getCurrentAvailableActions

    public com.camunda.scruffy.actions.GuiAction[] getCurrentAvailableActions(com.camunda.scruffy.components.GuiComponent form)

    getCurrentAvailableActionPopupMenu

    public javax.swing.JPopupMenu getCurrentAvailableActionPopupMenu(com.camunda.scruffy.components.GuiComponent forForm)
    returns a JPopupMenu Component containing items for all current active actions

    Parameters:
    forForm - JBopVisualComponent
    Returns:
    JMenu

    getCurrentAvailableActionMenu

    public javax.swing.JMenu getCurrentAvailableActionMenu(com.camunda.scruffy.components.GuiComponent forForm)
    returns a JMenu Component containing items for all current active actions

    Parameters:
    forForm - JBopVisualComponent
    Returns:
    JMenu

    getCurrentAvailableActionButtonBar

    public java.awt.Component getCurrentAvailableActionButtonBar(com.camunda.scruffy.components.GuiComponent form)

    getCurrentAvailableActionButtonBar

    public java.awt.Component getCurrentAvailableActionButtonBar()

    isActionsDeactivated

    public boolean isActionsDeactivated()

    getTaskInstance

    public org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance()

    getProcessInstance

    public org.jbpm.graph.exe.ProcessInstance getProcessInstance()

    reload

    public void reload()
    Reload the Data in this model


    addRemarks

    public void addRemarks()

    signal

    public void signal(org.jbpm.graph.def.Transition transition)
    if we have a new process, this process is created and started, if we have a TaskInstance, the task is ended with the given transition, else we send a signal to the RootToken.


    signal

    public void signal()

    signal

    public void signal(java.lang.String transitionName)
    if we have a new process, this process is created and started, if we have a TaskInstance, the task is ended with the given transition, else we send a signal to the RootToken.


    createBusinessObject

    public void createBusinessObject(java.lang.Object delegate,
                                     java.lang.String businessObjectVariableName,
                                     java.lang.String keyVariableName)
    save a business object into the business logic. This works if - the delegate has a method createOBJECT_NAME - OBJECT_NAME is the Class-Name of the Business Object (without DTO)


    updateBusinessObject

    public void updateBusinessObject(java.lang.Object delegate,
                                     java.lang.String businessObjectVariableName,
                                     java.lang.String keyVariableName)
    update a business object into the business logic. This works if - the delegate has a method updateOBJECT_NAME - OBJECT_NAME is the Class-Name of the Business Object (without DTO)


    updateBusinessObject

    public void updateBusinessObject(java.lang.Object delegate,
                                     java.lang.Object businessObject,
                                     java.lang.String keyVariableName)

    createBusinessObject

    public void createBusinessObject(java.lang.Object delegate,
                                     java.lang.Object businessObject,
                                     java.lang.String keyVariableName)

    saveBusinessObject

    public void saveBusinessObject(java.lang.Object delegate,
                                   java.lang.Object businessObject,
                                   java.lang.String keyVariableName,
                                   boolean create)

    getExectuionContext

    public org.jbpm.graph.exe.ExecutionContext getExectuionContext()

    loadAdditionalBusinessVariables

    public void loadAdditionalBusinessVariables()
    This method is called on the Server before the result is returned to the client So additioanl business variables can be loaded (in dependency of the process data for ecxample) overwrite to use that logic


    saveChangesOfAdditionalBusinessVariables

    public void saveChangesOfAdditionalBusinessVariables(java.util.Map variables)
    This method is called on the Server before special command (signal, end-task) are executet. So additioanl business variables can be updated (in dependency of the process data for ecxample) overwrite to use that logic


    clearCache

    public void clearCache()
    clear local cache of model


    getMainBoBean

    public java.lang.Object getMainBoBean()
    Returns:
    main business object contained in this process


    Copyright © 2007 camunda GmbH. All Rights Reserved.