public class WorkflowManager extends Object implements Serializable
This class also handles the relationships between visual and logical representation of workflow graph.
When reading a package from an XML file, this class creates imported objects and establishes relationship between graph objects (classes within bpd and bpd.graph package) and 'graph logic' objects ( classes within bpd.xml package).
| 构造器和说明 |
|---|
WorkflowManager(AbstractGraph g)
Creates new workflow manager for given graph.
|
WorkflowManager(AbstractGraph g,
PackageEditor pkgEditor) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
arrangeParticipants(Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Arranges participants according to the given property and parent maps.
|
protected void |
arrangeParticipantsVertically(Object[] pars,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Arranging heights and positions of given participants and positions of participants that must be translated due
to a change of given participants.
|
protected void |
arrangeParticipantVertically(Object par,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Resizing participant par and it's parents to appropriate height, and translating other participants accordingly
to changes of participant par.
|
protected void |
changeBounds(Object cell,
Map propertyMap,
Rectangle r)
Replaces bounding rectangle of given cell in propertyMap object with rectangle r if cell is contained within the
propertyMap object, otherwise adds new entry to the propertyMap that consists of given cell and a map containing
given rectangle r.
|
protected Activity |
createActivity(Point p,
Activity ap,
Map viewMap)
Creates new activity graph object, and associates the new XML logic activity object of Tool type to it.
|
protected AutoActivity |
createAutoActivity(Point p,
Activity ap,
Map viewMap)
Creates new route activity graph object, and associates the new XML logic activity object of AutoActivity type to
it.
|
protected BlockActivity |
createBlockActivity(Point p,
Activity ap,
Map viewMap)
Creates new graph BlockActivity object and associates the new XML logic activity object of BlockActivity type to
it.
|
protected DeviceActivity |
createDeviceActivity(Point p,
Activity ap,
Map viewMap)
Creates new route activity graph object, and associates the new XML logic activity object of AutoActivity type to
it.
|
protected End |
createEnd(Point p,
Map viewMap)
Creates end of graph object.
|
protected EventActivity |
createEventActivity(Point p,
Activity ap,
Map viewMap) |
protected Outflow |
createOutflow(Point p,
Activity ap,
Map viewMap)
Creates new graph subflow object and associates the new XML logic activity object of SubFlow type to it.
|
protected Participant |
createParticipant(Rectangle bounds,
Map viewMap)
Creates new graph participant object.
|
protected ServiceActivity |
createServiceActivity(Point p,
Activity ap,
Map viewMap)
Creates new route activity graph object, and associates the new XML logic activity object of AutoActivity type to
it.
|
protected Start |
createStart(Point p,
Map viewMap)
Creates start of graph object.
|
protected Subflow |
createSubflow(Point p,
Activity ap,
Map viewMap)
Creates new graph subflow object and associates the new XML logic activity object of SubFlow type to it.
|
void |
createWorkflowGraph(WorkflowProcess wp)
Creates graph representation of given workflow process.
|
Object |
findCell(Point p,
Map propertyMap) |
Object |
findNearestCell(Object selectedCell,
int direction)
Finds the nearest cell to the given cell in given direction.
|
protected Participant |
findParentActivityParticipantForLocation(Point loc,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Finds new participant for activity after it's position changes.
|
Activity |
getActivity(String ID)
Returns graph Activity object which represents the logical activity with given Id attribute.
|
static List<ProcessDef> |
getAllFlows() |
static Collection |
getAllRightGroup(WorkflowProcess process) |
Set |
getBlockActivities(boolean recursivly)
Returns the set of BlockActivity graph objects contained within the manager graph.
|
Rectangle2D |
getBounds(Object cell,
Map propertyMap)
Gets bounding rectangle of given cell.
|
protected Rectangle |
getBoundsOfParticipantFutureActivities(Participant par,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Gets the bounding rectangle of future children activities of given Participant par (that will be participants
activities after parent map is applied).
|
protected Set |
getEnds()
Returns set of ends of process/block.
|
static List<ProcessDef> |
getExtencwFlows()
/** 取得指定服务的所有流程集合
|
AbstractGraph |
getGraph()
Returns the graph which is managed.
|
int |
getHorizontalOffset()
Returns horizontal offset for inserting participants.
|
protected Participant |
getLeafParticipantForYPos(int yPos,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Returns leaf participant that bounds given y-coordinate.
|
WorkflowProcess |
getMainProcess()
WENZHANG 06-03-04 本方法存在缺陷使用时请注意条件 本方法适用的范围:每个包内只能有一个主流程 如果主流程不存在(包内只有一个或多个子流程情况可能存在) 如果存在多个主流程按顺序返回第一个
|
protected int |
getNewRootParYPos(Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Gets the insertation point (y-coordinate) of new root participant.
|
Point |
getOffset(Activity a)
Returns the point within the graph where the upper-left corner of given graph activity is placed.
|
static Collection |
getOutFlows(Package pk) |
Participant |
getParticipant(String ID)
Returns graph Participant object which represents the logical participant with given Id attribute.
|
protected Set |
getParticipantFutureActivities(Participant par,
org.jgraph.graph.ParentMap parentMap)
Gets future children activities of given participant par (that will be par's activities after parent map is
applied).
|
protected int |
getParticipantHeight(Object par,
Map propertyMap)
Gets height of given participant (from it's current view or from propertyMap).
|
String |
getParticipantID(Activity a)
Returns the Id attribute of (XML logic) Participant object, which graph object visually holds given activity
graph object.
|
protected Participant[] |
getParticipantsForYPos(int yPos,
int direction,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Returns participants that are under or above given yPos, or contains that y-position:
direction=0 -> under, direction=1 -> above, direction=2 -> contains. |
protected int |
getParticipantWidth(Object par,
Map propertyMap)
Gets width of given participant (from it's current view or from propertyMap).
|
static Collection |
getRightGroup(WorkflowProcess process)
得到指定流程定义的权限组
|
static String |
getRightGroupName(WorkflowProcess process,
String code) |
protected int |
getRootParticipantWidth(Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Gets the width of root participants.
|
protected Set |
getStarts()
Returns starts of process/block.
|
static Collection |
getSubFlows(Package pk)
得到指定package下的所有子流程
|
Transition |
getTransition(String ID)
Returns graph Transition object which represents the logical transition with given Id attribute.
|
Transitions |
getTransitionsCollection()
Returns the (XML logic) Transitions object, that holds all (XML logic) Transition objects which graphical
representation is managed by this workflow manager.
|
protected Rectangle |
getUnionBounds(Rectangle[] rects)
Gets union of given rectangles.
|
org.jgraph.graph.CellView |
getView(Object cell)
Gets view of given object.
|
XMLComplexElement |
getVisualOwner()
Returns the object (part of mapped XML logic) that is represented by the graph managed by WorklowManager.
|
Package |
getXMLPackage()
Returns the object representing the main element of XML file that defines the workflow model logic.
|
BPDGraphModel |
graphModel()
Returns the graph model - the model that represents the graph view.
|
protected boolean |
hasAnyActivity(Participant par,
org.jgraph.graph.ParentMap parentMap)
Checks if given participant par has activities.
|
protected boolean |
hasAnyParticipant(Participant par,
org.jgraph.graph.ParentMap parentMap)
Checks if given participant par has other participants.
|
void |
hideNode(Participant parUO)
Called when user wants to remove an existing (logical) participant from the graph.
|
void |
insertActivityAndArrangeParticipants(Point p)
Inserts new Activity cell at position p into model.
|
void |
insertAutoActivityAndArrangeParticipants(Point p)
Inserts new AutoActivity activity cell at position p into model.
|
void |
insertBlockActivityAndArrangeParticipants(Point p)
Inserts new BlockActivity cell at position p into model.
|
void |
insertCellsAndArrangeParticipants(Object[] insert,
Map viewMap)
Inserts cells insert into model.
|
void |
insertCellsAndArrangeParticipants(Object[] insert,
Map viewMap,
org.jgraph.graph.ConnectionSet cs) |
void |
insertDeviceActivityAndArrangeParticipants(Point p) |
void |
insertEndAndArrangeParticipants(Point p)
Inserts new End activity cell at position p into model.
|
void |
insertEventActivityAndArrangeParticipants(Point p) |
void |
insertOutflowAndArrangeParticipants(Point p)
Inserts new Subflow cell at position p into model.
|
Participant |
insertParticipantAndArrangeParticipants(Point p,
Participant parUO)
Inserts new Participant cell at position p into model.
|
Process |
insertProcess(WorkflowProcess workflowProcess,
boolean updateCollection)
Inserts new process cell into (graph) model and creates new (XML logic) WorkflowProcess object.
|
Process |
insertProcess(WorkflowProcess workflowProcess,
boolean updateCollection,
WFApplication app) |
void |
insertServiceActivityAndArrangeParticipants(Point p) |
void |
insertStartAndArrangeParticipants(Point p)
Inserts new Start activity cell at position p into model.
|
void |
insertSubflowAndArrangeParticipants(Point p)
Inserts new Subflow cell at position p into model.
|
Transition |
insertTransition(Point start,
Point end,
org.jgraph.graph.PortView source,
org.jgraph.graph.PortView target,
boolean isRouting,
boolean updateCollection)
Inserts new Transition cell, between points start and end, connected to the ports source and
target into model.
|
void |
moveCellsAndArrangeParticipants(Map propertyMap)
Moves cells given in a propertyMap to new location (also given in propertyMap.
|
Process |
newSubProcess(WFApplication app,
String processId) |
protected int |
optimalParticipantHeight(Participant par,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Calculates minimal participant height, which depends of position of all of its Activity cells.
|
protected int |
optimalRootParticipantWidth(Set participants,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Calculates the minimal width of root participants.
|
void |
refreshCollections(Object[] cellsToAddOrRemove,
boolean toAdd)
Refreshes the collections (adds or removes it's elements) of workflow logic objects (activities, transitions,
workflow processes, block activities) corresponding to the graph objects that are beeing added to or removed from
graph.
|
void |
removeCellsAndArrangeParticipants(Object[] cellsToDelete)
Removes cells cellsToDelete from model.
|
protected void |
resize(Object[] cells,
Map propertyMap,
int dw,
int dh)
Resizes given participants.
|
protected void |
resizeAllParticipantsHorizontally(Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Method that resizes all participants horizontally to get there minimal needed sizes.
|
boolean |
showNode(Participant parUO)
Called when user wants to insert an existing (logical) participant into graph.
|
protected void |
translateParticipant(Participant par,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap,
int dx,
int dy)
Translates single participant and its children.The method checks for bounds of cells within propertyMap and uses
parentMap to translate right children (the children that will be it's after applying parentMap).
|
protected void |
translateParticipants(Participant[] cells,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap,
int dx,
int dy)
Translates given participants using propertyMap for bounds checking and parentMap for future children checking.
|
protected void |
translateVertically(Map propertyMap,
org.jgraph.graph.ParentMap parentMap,
int yPos,
int dv)
Translates participants under given position yPos vertically for a value of dv.
|
protected Set |
updateActivityParent(Activity ac,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap)
Determines old and new participant for activity, adjusts activities position if needed and properly changes
parent of activity (adds entry into the parentMap).
|
static void |
updateActivityPosition(WorkflowProcess wp) |
void |
updateJoin(Activity t) |
void |
updateModelAndArrangeParticipants(Object[] insert,
Map propertyMap,
org.jgraph.graph.ConnectionSet cs,
org.jgraph.graph.ParentMap parentMap,
Map viewMap,
String actionName,
boolean updateCollection) |
protected void |
updateModelAndArrangeParticipants(Object[] insert,
Map propertyMap,
org.jgraph.graph.ParentMap parentMap,
Map viewMap,
String actionName,
boolean updateCollection)
Inserts new activities into model, changes positions and sizes of participants due to a insertion of new
activities or due to a moving of activities.
|
void |
updateSplit(Activity s) |
public WorkflowManager(AbstractGraph g)
g - The graph that manager manages.public WorkflowManager(AbstractGraph g, PackageEditor pkgEditor)
public AbstractGraph getGraph()
public Package getXMLPackage()
public BPDGraphModel graphModel()
public void createWorkflowGraph(WorkflowProcess wp)
This is used when reading a workflow definition from an XML file.
wp - Object that mapps the logic of WorkflowProcess element of XML - defines a particular Workflow process.public XMLComplexElement getVisualOwner()
public Transitions getTransitionsCollection()
public Process insertProcess(WorkflowProcess workflowProcess, boolean updateCollection)
updateCollection - true if collection of WorkflowProcess objects should be updated (user inserts object), and
false if not (XML file is importing, and objects are constructed depending on data held
within the file).public WorkflowProcess getMainProcess()
public Process newSubProcess(WFApplication app, String processId)
public Process insertProcess(WorkflowProcess workflowProcess, boolean updateCollection, WFApplication app)
public void insertCellsAndArrangeParticipants(Object[] insert, Map viewMap)
public void insertCellsAndArrangeParticipants(Object[] insert, Map viewMap, org.jgraph.graph.ConnectionSet cs)
public void moveCellsAndArrangeParticipants(Map propertyMap)
public void insertSubflowAndArrangeParticipants(Point p)
public void insertOutflowAndArrangeParticipants(Point p)
public void insertBlockActivityAndArrangeParticipants(Point p)
public void insertStartAndArrangeParticipants(Point p)
public void insertEndAndArrangeParticipants(Point p)
public void insertActivityAndArrangeParticipants(Point p)
public void insertAutoActivityAndArrangeParticipants(Point p)
public void insertServiceActivityAndArrangeParticipants(Point p)
public void insertDeviceActivityAndArrangeParticipants(Point p)
public void insertEventActivityAndArrangeParticipants(Point p)
public Participant insertParticipantAndArrangeParticipants(Point p, Participant parUO)
p - The position of participant within the graph.parUO - The XML logic object that holds the data for participant to be inserted and that will be held as a
property of the graph object.public boolean showNode(Participant parUO)
public void hideNode(Participant parUO)
public Transition insertTransition(Point start, Point end, org.jgraph.graph.PortView source, org.jgraph.graph.PortView target, boolean isRouting, boolean updateCollection)
start - The position of start point of transition within the graph.end - The position of end point of transition within the graph.source - The source port of transition's graph object.target - The target port of transition's graph object.updateCollection - true if collection of Transition objects should be updated (user inserts object), and
false if not (XML file is importing, and objects are constructed depending on data held
within the file).public void removeCellsAndArrangeParticipants(Object[] cellsToDelete)
public int getHorizontalOffset()
public String getParticipantID(Activity a)
public Point getOffset(Activity a)
public Set getBlockActivities(boolean recursivly)
protected Participant createParticipant(Rectangle bounds, Map viewMap)
protected Subflow createSubflow(Point p, Activity ap, Map viewMap)
protected Outflow createOutflow(Point p, Activity ap, Map viewMap)
protected BlockActivity createBlockActivity(Point p, Activity ap, Map viewMap)
protected Activity createActivity(Point p, Activity ap, Map viewMap)
protected AutoActivity createAutoActivity(Point p, Activity ap, Map viewMap)
protected ServiceActivity createServiceActivity(Point p, Activity ap, Map viewMap)
protected DeviceActivity createDeviceActivity(Point p, Activity ap, Map viewMap)
protected EventActivity createEventActivity(Point p, Activity ap, Map viewMap)
protected void updateModelAndArrangeParticipants(Object[] insert, Map propertyMap, org.jgraph.graph.ParentMap parentMap, Map viewMap, String actionName, boolean updateCollection)
public void updateModelAndArrangeParticipants(Object[] insert, Map propertyMap, org.jgraph.graph.ConnectionSet cs, org.jgraph.graph.ParentMap parentMap, Map viewMap, String actionName, boolean updateCollection)
protected void arrangeParticipants(Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected Set updateActivityParent(Activity ac, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected Participant findParentActivityParticipantForLocation(Point loc, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected void arrangeParticipantsVertically(Object[] pars, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected void arrangeParticipantVertically(Object par, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected void resizeAllParticipantsHorizontally(Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected int optimalRootParticipantWidth(Set participants, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected int optimalParticipantHeight(Participant par, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected void resize(Object[] cells, Map propertyMap, int dw, int dh)
protected void translateVertically(Map propertyMap, org.jgraph.graph.ParentMap parentMap, int yPos, int dv)
protected void translateParticipants(Participant[] cells, Map propertyMap, org.jgraph.graph.ParentMap parentMap, int dx, int dy)
protected void translateParticipant(Participant par, Map propertyMap, org.jgraph.graph.ParentMap parentMap, int dx, int dy)
protected Rectangle getBoundsOfParticipantFutureActivities(Participant par, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected Set getParticipantFutureActivities(Participant par, org.jgraph.graph.ParentMap parentMap)
protected Participant getLeafParticipantForYPos(int yPos, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected Participant[] getParticipantsForYPos(int yPos, int direction, Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected int getNewRootParYPos(Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected int getRootParticipantWidth(Map propertyMap, org.jgraph.graph.ParentMap parentMap)
protected boolean hasAnyParticipant(Participant par, org.jgraph.graph.ParentMap parentMap)
This method has meaning in previous versions of BPD, now it always returns false.
protected boolean hasAnyActivity(Participant par, org.jgraph.graph.ParentMap parentMap)
protected Set getStarts()
protected Set getEnds()
public org.jgraph.graph.CellView getView(Object cell)
protected int getParticipantWidth(Object par, Map propertyMap)
protected int getParticipantHeight(Object par, Map propertyMap)
protected void changeBounds(Object cell, Map propertyMap, Rectangle r)
public Rectangle2D getBounds(Object cell, Map propertyMap)
protected Rectangle getUnionBounds(Rectangle[] rects)
public Activity getActivity(String ID)
public Transition getTransition(String ID)
public Participant getParticipant(String ID)
public void refreshCollections(Object[] cellsToAddOrRemove, boolean toAdd)
cellsToAddOrRemove - The graph objects that are beeing added to or removed from graph.toAdd - true if graph objects are beeing added, false otherwise.public Object findNearestCell(Object selectedCell, int direction)
selectedCell - first currently selected celldirection - 0-Up, 1-Down, 2-Left, 3-Right (if given some other no, the Up is assumed)public static Collection getRightGroup(WorkflowProcess process)
process - 给定的流程public static Collection getAllRightGroup(WorkflowProcess process)
public static String getRightGroupName(WorkflowProcess process, String code)
public static Collection getSubFlows(Package pk)
pk - 给定的packagepublic static List<ProcessDef> getExtencwFlows()
AxisFaultRemoteExceptionpublic static List<ProcessDef> getAllFlows()
public static Collection getOutFlows(Package pk)
public static void updateActivityPosition(WorkflowProcess wp)
public void updateSplit(Activity s)
public void updateJoin(Activity t)
Copyright © 2023 onecode. All rights reserved.