亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? abstractworkflow.java

?? 一個很好實用的工作流OSWORKFLOW開發例子.有著非常優秀的靈活性.
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * Copyright (c) 2002-2003 by OpenSymphony * All rights reserved. */package com.opensymphony.workflow;import com.opensymphony.module.propertyset.PropertySet;import com.opensymphony.module.propertyset.PropertySetManager;import com.opensymphony.workflow.config.Configuration;import com.opensymphony.workflow.config.DefaultConfiguration;import com.opensymphony.workflow.loader.*;import com.opensymphony.workflow.query.WorkflowExpressionQuery;import com.opensymphony.workflow.query.WorkflowQuery;import com.opensymphony.workflow.spi.*;import com.opensymphony.workflow.util.VariableResolver;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import java.util.*;/** * Abstract workflow instance that serves as the base for specific implementations, such as EJB or SOAP. * * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a> * @author Hani Suleiman */public class AbstractWorkflow implements Workflow {    //~ Static fields/initializers /////////////////////////////////////////////    private static final Log log = LogFactory.getLog(AbstractWorkflow.class);    //~ Instance fields ////////////////////////////////////////////////////////    protected WorkflowContext context;    private Configuration configuration;    private ThreadLocal stateCache = new ThreadLocal();    private TypeResolver typeResolver;    //~ Constructors ///////////////////////////////////////////////////////////    public AbstractWorkflow() {        stateCache.set(new HashMap());    }    //~ Methods ////////////////////////////////////////////////////////////////    /**     * @ejb.interface-method     * @deprecated use {@link #getAvailableActions(long, Map)}  with an empty Map instead.     */    public int[] getAvailableActions(long id) {        return getAvailableActions(id, new HashMap());    }    /**     * Get the available actions for the specified workflow instance.     * @ejb.interface-method     * @param id The workflow instance id.     * @param inputs The inputs map to pass on to conditions     * @return An array of action id's that can be performed on the specified entry.     * @throws IllegalArgumentException if the specified id does not exist, or if its workflow     * descriptor is no longer available or has become invalid.     */    public int[] getAvailableActions(long id, Map inputs) {        try {            WorkflowStore store = getPersistence();            WorkflowEntry entry = store.findEntry(id);            if (entry == null) {                throw new IllegalArgumentException("No such workflow id " + id);            }            if (entry.getState() != WorkflowEntry.ACTIVATED) {                return new int[0];            }            WorkflowDescriptor wf = getConfiguration().getWorkflow(entry.getWorkflowName());            if (wf == null) {                throw new IllegalArgumentException("No such workflow " + entry.getWorkflowName());            }            List l = new ArrayList();            PropertySet ps = store.getPropertySet(id);            Map transientVars = (inputs == null) ? new HashMap() : new HashMap(inputs);            Collection currentSteps = store.findCurrentSteps(id);            populateTransientMap(entry, transientVars, wf.getRegisters(), new Integer(0), currentSteps, ps);            // get global actions            List globalActions = wf.getGlobalActions();            for (Iterator iterator = globalActions.iterator();                    iterator.hasNext();) {                ActionDescriptor action = (ActionDescriptor) iterator.next();                RestrictionDescriptor restriction = action.getRestriction();                ConditionsDescriptor conditions = null;                transientVars.put("actionId", new Integer(action.getId()));                if (restriction != null) {                    conditions = restriction.getConditionsDescriptor();                }                //todo verify that 0 is the right currentStepId                if (passesConditions(wf.getGlobalConditions(), transientVars, ps, 0) && passesConditions(conditions, transientVars, ps, 0)) {                    l.add(new Integer(action.getId()));                }            }            // get normal actions            for (Iterator iterator = currentSteps.iterator();                    iterator.hasNext();) {                Step step = (Step) iterator.next();                l.addAll(getAvailableActionsForStep(wf, step, transientVars, ps));            }            int[] actions = new int[l.size()];            for (int i = 0; i < actions.length; i++) {                actions[i] = ((Integer) l.get(i)).intValue();            }            return actions;        } catch (Exception e) {            log.error("Error checking available actions", e);            return new int[0];        }    }    /**     * @ejb.interface-method     */    public void setConfiguration(Configuration configuration) {        this.configuration = configuration;    }    /**     * Get the configuration for this workflow.     * This method also checks if the configuration has been initialized, and if not, initializes it.     * @return The configuration that was set.     * If no configuration was set, then the default (static) configuration is returned.     *     */    public Configuration getConfiguration() {        Configuration config = (configuration != null) ? configuration : DefaultConfiguration.INSTANCE;        if (!config.isInitialized()) {            try {                config.load(null);            } catch (FactoryException e) {                log.fatal("Error initialising configuration", e);                //fail fast, better to blow up with an NPE that hide the error                return null;            }        }        return config;    }    /**     * @ejb.interface-method     */    public List getCurrentSteps(long id) {        try {            WorkflowStore store = getPersistence();            return store.findCurrentSteps(id);        } catch (StoreException e) {            log.error("Error checking current steps for instance #" + id, e);            return Collections.EMPTY_LIST;        }    }    /**     * @ejb.interface-method     */    public int getEntryState(long id) {        try {            WorkflowStore store = getPersistence();            return store.findEntry(id).getState();        } catch (StoreException e) {            log.error("Error checking instance state for instance #" + id, e);        }        return WorkflowEntry.UNKNOWN;    }    /**     * @ejb.interface-method     */    public List getHistorySteps(long id) {        try {            WorkflowStore store = getPersistence();            return store.findHistorySteps(id);        } catch (StoreException e) {            log.error("Error getting history steps for instance #" + id, e);        }        return Collections.EMPTY_LIST;    }    /**     * @ejb.interface-method     */    public Properties getPersistenceProperties() {        Properties p = new Properties();        Iterator iter = getConfiguration().getPersistenceArgs().entrySet().iterator();        while (iter.hasNext()) {            Map.Entry entry = (Map.Entry) iter.next();            p.setProperty((String) entry.getKey(), (String) entry.getValue());        }        return p;    }    /**     * Get the PropertySet for the specified workflow ID     * @ejb.interface-method     * @param id The workflow ID     */    public PropertySet getPropertySet(long id) {        PropertySet ps = null;        try {            ps = getPersistence().getPropertySet(id);        } catch (StoreException e) {            log.error("Error getting propertyset for instance #" + id, e);        }        return ps;    }    public void setResolver(TypeResolver resolver) {        this.typeResolver = resolver;    }    public TypeResolver getResolver() {        if (typeResolver == null) {            typeResolver = TypeResolver.getResolver();        }        return typeResolver;    }    /**     * @ejb.interface-method     */    public List getSecurityPermissions(long id) {        return getSecurityPermissions(id, null);    }    /**     * @ejb.interface-method     */    public List getSecurityPermissions(long id, Map inputs) {        try {            WorkflowStore store = getPersistence();            WorkflowEntry entry = store.findEntry(id);            WorkflowDescriptor wf = getConfiguration().getWorkflow(entry.getWorkflowName());            PropertySet ps = store.getPropertySet(id);            Map transientVars = (inputs == null) ? new HashMap() : new HashMap(inputs);            Collection currentSteps = store.findCurrentSteps(id);            populateTransientMap(entry, transientVars, wf.getRegisters(), null, currentSteps, ps);            List s = new ArrayList();            for (Iterator interator = currentSteps.iterator();                    interator.hasNext();) {                Step step = (Step) interator.next();                int stepId = step.getStepId();                StepDescriptor xmlStep = wf.getStep(stepId);                List securities = xmlStep.getPermissions();                for (Iterator iterator2 = securities.iterator();                        iterator2.hasNext();) {                    PermissionDescriptor security = (PermissionDescriptor) iterator2.next();                    // to have the permission, the condition must be met or not specified                    // securities can't have restrictions based on inputs, so it's null                    if (security.getRestriction() != null) {                        if (passesConditions(security.getRestriction().getConditionsDescriptor(), transientVars, ps, xmlStep.getId())) {                            s.add(security.getName());                        }                    }                }            }            return s;        } catch (Exception e) {            log.error("Error getting security permissions for instance #" + id, e);        }        return Collections.EMPTY_LIST;    }    /**     * Returns a workflow definition object associated with the given name.     *     * @param workflowName the name of the workflow     * @return the object graph that represents a workflow definition     * @ejb.interface-method     */    public WorkflowDescriptor getWorkflowDescriptor(String workflowName) {        try {            return getConfiguration().getWorkflow(workflowName);        } catch (FactoryException e) {            log.error("Error loading workflow " + workflowName, e);        }        return null;    }    /**     * @ejb.interface-method     */    public String getWorkflowName(long id) {        try {            WorkflowStore store = getPersistence();            WorkflowEntry entry = store.findEntry(id);            if (entry != null) {                return entry.getWorkflowName();            }        } catch (StoreException e) {            log.error("Error getting instance name for instance #" + id, e);        }        return null;    }    /**     * Get a list of workflow names available     * @return String[] an array of workflow names.     * @ejb.interface-method     */    public String[] getWorkflowNames() {        try {            return getConfiguration().getWorkflowNames();        } catch (FactoryException e) {            log.error("Error getting workflow names", e);        }        return new String[0];    }    /**     * @ejb.interface-method     */    public boolean canInitialize(String workflowName, int initialAction) {        return canInitialize(workflowName, initialAction, null);    }    /**     * @ejb.interface-method     * @param workflowName the name of the workflow to check     * @param initialAction The initial action to check     * @param inputs the inputs map     * @return true if the workflow can be initialized     */    public boolean canInitialize(String workflowName, int initialAction, Map inputs) {        final String mockWorkflowName = workflowName;        WorkflowEntry mockEntry = new WorkflowEntry() {            public long getId() {                return 0;            }            public String getWorkflowName() {                return mockWorkflowName;            }            public boolean isInitialized() {                return false;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大片免费久久精品三p| 亚洲一区日韩精品中文字幕| 成人欧美一区二区三区白人| 日韩精品1区2区3区| 不卡一二三区首页| 欧美一级欧美三级| 亚洲影视资源网| 成人一区二区在线观看| 日韩欧美一级二级三级久久久| 综合电影一区二区三区| 国产美女av一区二区三区| 欧美日韩精品一二三区| 尤物在线观看一区| 91天堂素人约啪| 欧美激情综合在线| 国产一区二区精品在线观看| 91精品在线观看入口| 亚洲综合久久久| 色久优优欧美色久优优| 亚洲欧美一区二区三区极速播放| 国内外成人在线视频| 精品国产一区久久| 久久成人久久爱| 日韩一级精品视频在线观看| 日韩精品一二三区| 欧美一卡二卡在线观看| 日韩精品免费视频人成| 欧美放荡的少妇| 亚洲电影你懂得| 欧美欧美午夜aⅴ在线观看| 亚洲成人免费av| 91精品国产麻豆| 美国欧美日韩国产在线播放| 日韩一级完整毛片| 国产一区二区看久久| 亚洲乱码国产乱码精品精的特点| 51精品秘密在线观看| 一区二区不卡在线播放 | 中文字幕中文字幕一区二区| 高清视频一区二区| 亚洲天堂成人在线观看| 在线精品观看国产| 午夜电影久久久| 26uuu亚洲| 99国产精品久久久久| 亚洲精品国产视频| 欧美三级三级三级爽爽爽| 婷婷一区二区三区| 日韩精品中文字幕在线不卡尤物| 国产精品1024| 一区二区三区在线视频观看58| 欧美日韩在线播放三区四区| 久久精品国产一区二区三区免费看| 精品少妇一区二区三区视频免付费 | 欧美大片在线观看一区二区| 九色综合国产一区二区三区| 国产色爱av资源综合区| av亚洲精华国产精华精华| 亚洲图片欧美一区| 亚洲精品在线网站| 色婷婷av久久久久久久| 麻豆成人久久精品二区三区小说| 久久久久国产精品人| 色激情天天射综合网| 久久国产夜色精品鲁鲁99| 日韩一区日韩二区| 欧美电影免费观看高清完整版在线 | 国产亚洲欧美色| www.视频一区| 亚洲成人黄色小说| 久久精品视频免费观看| 在线日韩av片| 国产在线一区二区| 一级特黄大欧美久久久| 久久久亚洲高清| 制服丝袜亚洲精品中文字幕| 不卡一二三区首页| 精品在线你懂的| 午夜免费欧美电影| 一区在线播放视频| 精品国产91洋老外米糕| 欧美日韩mp4| 色综合久久综合网欧美综合网| 激情久久五月天| 日本视频一区二区三区| 亚洲精品写真福利| 国产精品麻豆欧美日韩ww| 日韩精品一区二区三区swag | 色综合久久66| 成人在线视频一区二区| 久久精品国产网站| 天天综合网天天综合色| 亚洲伦理在线精品| 亚洲欧美电影一区二区| 91精品一区二区三区在线观看| 亚洲二区视频在线| 国产精品伦理在线| 久久久久国产精品麻豆ai换脸| 在线播放亚洲一区| 欧美日韩国产首页在线观看| 日本韩国一区二区| 一本大道久久a久久综合| 不卡视频免费播放| 成人久久视频在线观看| 福利电影一区二区| 国产精品一区二区三区乱码| 国产主播一区二区三区| 国内精品国产三级国产a久久| 亚洲第一久久影院| 亚洲图片欧美激情| 国产精品理论片在线观看| 久久精品无码一区二区三区| 久久久久久久精| 精品91自产拍在线观看一区| 精品国产乱码久久久久久久久 | 亚洲成人资源在线| 一区二区三区不卡视频| 亚洲综合精品久久| 五月天久久比比资源色| 日本不卡在线视频| 韩国视频一区二区| 国产成人日日夜夜| 99精品欧美一区| 色综合久久天天综合网| 欧美三级中文字幕在线观看| 69p69国产精品| 欧美大肚乱孕交hd孕妇| 2020国产精品自拍| 亚洲国产精品成人久久综合一区 | 在线免费观看日韩欧美| 欧美日韩国产小视频| 欧美成人性福生活免费看| 久久精品一二三| 亚洲欧美乱综合| 天天综合网天天综合色| 国内成+人亚洲+欧美+综合在线 | 欧美一区二区久久久| 久久影院视频免费| 中文字幕一区二区5566日韩| 亚洲网友自拍偷拍| 激情五月婷婷综合| 99久久婷婷国产综合精品电影| 欧美性大战久久| 久久久久久**毛片大全| 亚洲最新视频在线观看| 激情综合网激情| 色婷婷一区二区三区四区| 日韩午夜激情av| 亚洲欧美日韩一区二区| 日本免费新一区视频| 成人国产精品免费| 欧美一区二区精品在线| 亚洲欧美激情一区二区| 久久激五月天综合精品| 99久久精品99国产精品| 日韩欧美国产一区二区在线播放| 最新国产精品久久精品| 免费成人在线影院| 在线精品视频一区二区| 国产午夜精品理论片a级大结局| 亚洲综合激情小说| 成人深夜视频在线观看| 日韩欧美在线一区二区三区| 综合在线观看色| 国产精品99久久久久久久vr| 欧美日韩不卡视频| 亚洲欧美综合在线精品| 国产乱一区二区| 欧美一区午夜视频在线观看| 一区二区三区在线免费视频| 国产大陆亚洲精品国产| 91精品免费观看| 亚洲最大色网站| 91美女在线视频| 中文一区二区在线观看| 九九九精品视频| 欧美一区2区视频在线观看| 亚洲一区二区三区中文字幕在线| 粉嫩13p一区二区三区| 久久久精品国产免大香伊| 男人的j进女人的j一区| 欧美精品日日鲁夜夜添| 亚洲激情一二三区| 99视频在线观看一区三区| 国产欧美视频在线观看| 国内欧美视频一区二区| 精品国精品自拍自在线| 首页国产丝袜综合| 欧美最新大片在线看 | 蜜臀久久久久久久| 欧美人体做爰大胆视频| 亚洲一区免费观看| 欧美日免费三级在线| 一区二区三区四区蜜桃| 国产麻豆精品视频| 欧美综合亚洲图片综合区| 国产精品视频第一区| 国产白丝精品91爽爽久久| 国产三级一区二区三区| 高清视频一区二区|