本文整理汇总了Java中org.jbpm.graph.def.Action类的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Action类属于org.jbpm.graph.def包,在下文中一共展示了Action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readActions
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public void readActions(Element eventElement, GraphElement graphElement, String eventType) {
// for all the elements in the event element
Iterator nodeElementIter = eventElement.elementIterator();
while (nodeElementIter.hasNext()) {
Element actionElement = (Element) nodeElementIter.next();
String actionName = actionElement.getName();
if (ActionTypes.hasActionName(actionName)) {
Action action = createAction(actionElement);
if ( (graphElement!=null)
&& (eventType!=null)
) {
// add the action to the event
addAction(graphElement, eventType, action);
}
}
}
}
示例2: readExceptionHandler
import org.jbpm.graph.def.Action; //导入依赖的package包/类
protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement) {
// create the exception handler
ExceptionHandler exceptionHandler = new ExceptionHandler();
exceptionHandler.setExceptionClassName(exceptionHandlerElement.attributeValue("exception-class"));
// add it to the graph element
graphElement.addExceptionHandler(exceptionHandler);
// read the actions in the body of the exception-handler element
Iterator iter = exceptionHandlerElement.elementIterator();
while (iter.hasNext()) {
Element childElement = (Element) iter.next();
if (ActionTypes.hasActionName(childElement.getName())) {
Action action = createAction(childElement);
exceptionHandler.addAction(action);
}
}
}
示例3: execute
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public Object execute(JbpmContext jbpmContext) throws Exception {
Action action = null;
TaskInstance ti = null;
ProcessInstance pi = null;
if (isTaskInstance) {
ti = jbpmContext.getTaskInstance(id);
action = ti.getTaskMgmtInstance().getProcessInstance().getProcessDefinition().getAction(actionName);
} else {
pi = jbpmContext.getProcessInstance(id);
action = pi.getProcessDefinition().getAction(actionName);
}
if (!goBack) {
if (isTaskInstance) {
ExecutionContext ec = new ExecutionContext(ti.getToken());
ec.setTaskInstance(ti);
ti.getTask().executeAction(action, ec);
} else {
pi.getProcessDefinition().executeAction(
action,
new ExecutionContext(pi.getRootToken()));
}
} else {
executeGoBack(action, new ExecutionContext(pi.getRootToken()));
}
return null;
}
示例4: executeGoBack
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public void executeGoBack(Action action, ExecutionContext context) throws Exception {
if (action != null && action.getActionDelegation() != null) {
ClassLoader surroundingClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(context.getProcessDefinition()));
Object actionHandler = action.getActionDelegation().getInstance();
if (actionHandler instanceof AccioExternaRetrocedirHandler) {
((AccioExternaRetrocedirHandler)actionHandler).retrocedir(context, params);
}/* else if (actionHandler instanceof HeliumActionHandler) {
HeliumApi heliumApi = new HeliumApiImpl(context);
((HeliumActionHandler)actionHandler).retrocedir(heliumApi, params);
}*/
} finally {
Thread.currentThread().setContextClassLoader(surroundingClassLoader);
}
}
}
示例5: ProcessDefinitionInfo
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public ProcessDefinitionInfo(
long id,
String name,
String description,
int version,
boolean isTerminationImplicit,
Node startState,
List<Node> nodes,
Map<String, Action> actions) {
super();
this.id = id;
this.name = name;
this.description = description;
this.version = version;
this.isTerminationImplicit = isTerminationImplicit;
this.startState = startState;
this.nodes = nodes;
this.actions = actions;
}
示例6: NodeInfo
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public NodeInfo(
long id,
String name,
String description,
ProcessDefinition processDefinition,
List<Transition> leavingTransitions,
Set<Transition> arrivingTransitions,
Action action,
boolean isAsync,
boolean isAsyncExclusive) {
super();
this.id = id;
this.name = name;
this.description = description;
this.processDefinition = processDefinition;
this.leavingTransitions = leavingTransitions;
this.arrivingTransitions = arrivingTransitions;
this.action = action;
this.isAsync = isAsync;
this.isAsyncExclusive = isAsyncExclusive;
}
示例7: TimerInfo
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public TimerInfo(long id, int version, Date dueDate, ProcessInstance processInstance, Token token,
TaskInstance taskInstance, boolean isSuspended, boolean isExclusive, String lockOwner, Date lockTime,
String exception, int retries, String configuration, String name, String repeat, String transitionName,
Action action) {
super();
this.id = id;
this.version = version;
this.dueDate = dueDate;
this.processInstance = processInstance;
this.token = token;
this.taskInstance = taskInstance;
this.isSuspended = isSuspended;
this.isExclusive = isExclusive;
this.lockOwner = lockOwner;
this.lockTime = lockTime;
this.exception = exception;
this.retries = retries;
this.configuration = configuration;
this.name = name;
this.repeat = repeat;
this.transitionName = transitionName;
this.action = action;
}
示例8: findReferencingDelegatingActions
import org.jbpm.graph.def.Action; //导入依赖的package包/类
protected List<Action> findReferencingDelegatingActions(Long processDefinitionId) {
Query query = session.createQuery(
" select a "
+ " from org.jbpm.graph.def.Action a, "
+ " org.jbpm.instantiation.Delegation d "
+ "where d.processDefinition.id = :processDefinitionId "
+ " and a.actionDelegation.id = d.id");
query.setLong("processDefinitionId", processDefinitionId);
return (List<Action>)query.list();
}
示例9: findReferencedActionLogs
import org.jbpm.graph.def.Action; //导入依赖的package包/类
protected List<ActionLog> findReferencedActionLogs(List<Action> accions) {
Query query = session.createQuery(
" select al "
+ " from org.jbpm.graph.log.ActionLog al "
+ "where al.action in (:accions)");
query.setParameterList("accions", accions);
return (List<ActionLog>)query.list();
}
示例10: readSingleAction
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public Action readSingleAction(Element nodeElement) {
Action action = null;
// search for the first action element in the node
Iterator iter = nodeElement.elementIterator();
while (iter.hasNext() && (action==null)) {
Element candidate = (Element) iter.next();
if (ActionTypes.hasActionName(candidate.getName())) {
// parse the action and assign it to this node
action = createAction(candidate);
}
}
return action;
}
示例11: readAction
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public void readAction(Element element, Action action) {
// if a name is specified for this action
String actionName = element.attributeValue("name");
if (actionName!=null) {
action.setName(actionName);
// add the action to the named process action repository
processDefinition.addAction(action);
}
// if the action is parsable
// (meaning: if the action has special configuration to parse, other then the common node data)
action.read(element, this);
}
示例12: resolveActionReferences
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public void resolveActionReferences() {
Iterator iter = unresolvedActionReferences.iterator();
while (iter.hasNext()) {
Object[] unresolvedActionReference = (Object[]) iter.next();
Element actionElement = (Element) unresolvedActionReference[0];
Action action = (Action) unresolvedActionReference[1];
String referencedActionName = actionElement.attributeValue("ref-name");
Action referencedAction = processDefinition.getAction(referencedActionName);
if (referencedAction==null) {
addWarning("couldn't resolve action reference in "+actionElement.asXML());
}
action.setReferencedAction(referencedAction);
}
}
示例13: findReplacementAction
import org.jbpm.graph.def.Action; //导入依赖的package包/类
private Action findReplacementAction(ProcessDefinition newDef, Action oldAction) {
Action newAction = null;
if (oldAction.getName() != null) {
newAction = newDef.getAction(oldAction.getName());
}
if (newAction == null) {
throw new JbpmException("Action '" + oldAction.getName() + "' not found in new process definition");
}
return newAction;
}
示例14: toActionInfo
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public static ActionInfo toActionInfo(Action action) {
if (action == null)
return null;
return new ActionInfo(
action.getId(),
action.getName(),
action.isPropagationAllowed(),
action.isAsync(),
action.isAsyncExclusive(),
action.getActionExpression(),
action.getProcessDefinition());
}
示例15: getActions
import org.jbpm.graph.def.Action; //导入依赖的package包/类
public Map<String, ActionInfo> getActions() {
Map<String, ActionInfo> actionsInfo = new HashMap<String, ActionInfo>();
for (Entry<String, Action> entry: actions.entrySet()) {
actionsInfo.put(entry.getKey(), ConversioTipusInfoHelper.toActionInfo(entry.getValue()));
}
return actionsInfo;
}