當前位置: 首頁>>代碼示例>>Java>>正文


Java Action類代碼示例

本文整理匯總了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);
      }
    }
  }
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:18,代碼來源:JpdlXmlReader.java

示例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);
    }
  }
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:18,代碼來源:JpdlXmlReader.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:27,代碼來源:ExecuteActionCommand.java

示例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);
		}
	}
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:18,代碼來源:ExecuteActionCommand.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:20,代碼來源:ProcessDefinitionInfo.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:22,代碼來源:NodeInfo.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:24,代碼來源:TimerInfo.java

示例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();
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:11,代碼來源:GraphSession.java

示例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();
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:9,代碼來源:GraphSession.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:14,代碼來源:JpdlXmlReader.java

示例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);
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:14,代碼來源:JpdlXmlReader.java

示例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);
  }
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:15,代碼來源:JpdlXmlReader.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:13,代碼來源:ChangeProcessInstanceVersionCommand.java

示例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());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:14,代碼來源:ConversioTipusInfoHelper.java

示例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;
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:8,代碼來源:ProcessDefinitionInfo.java


注:本文中的org.jbpm.graph.def.Action類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。