• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ExecutionContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jbpm.graph.exe.ExecutionContext的典型用法代码示例。如果您正苦于以下问题:Java ExecutionContext类的具体用法?Java ExecutionContext怎么用?Java ExecutionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExecutionContext类属于org.jbpm.graph.exe包,在下文中一共展示了ExecutionContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getInitializedSwimlaneInstance

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public SwimlaneInstance getInitializedSwimlaneInstance(ExecutionContext executionContext, Swimlane swimlane)
{
  // initialize the swimlane
  if (swimlaneInstances == null)
    swimlaneInstances = new HashMap<String, SwimlaneInstance>();
  SwimlaneInstance swimlaneInstance = swimlaneInstances.get(swimlane.getName());
  if (swimlaneInstance == null)
  {
    swimlaneInstance = new SwimlaneInstance(swimlane);
    addSwimlaneInstance(swimlaneInstance);
    // assign the swimlaneInstance
    performAssignment(swimlane.getAssignmentDelegation(), swimlane.getActorIdExpression(), swimlane.getPooledActorsExpression(), swimlaneInstance,
        executionContext);
  }

  return swimlaneInstance;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:18,代码来源:TaskMgmtInstance.java


示例2: performAssignmentDelegation

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
void performAssignmentDelegation(Delegation assignmentDelegation, Assignable assignable, ExecutionContext executionContext) throws Exception
{
  ClassLoader surroundingClassLoader = Thread.currentThread().getContextClassLoader();
  try
  {
    // set context class loader correctly for delegation class (https://jira.jboss.org/jira/browse/JBPM-1448)
    Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(executionContext.getProcessDefinition()));

    // instantiate the assignment handler
    AssignmentHandler assignmentHandler = (AssignmentHandler)assignmentDelegation.instantiate();
    // invoke the assignment handler
    if (UserCodeInterceptorConfig.userCodeInterceptor != null)
    {
      UserCodeInterceptorConfig.userCodeInterceptor.executeAssignment(assignmentHandler, assignable, executionContext);
    }
    else
    {
      assignmentHandler.assign(assignable, executionContext);
    }

  }
  finally
  {
    Thread.currentThread().setContextClassLoader(surroundingClassLoader);
  }
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:27,代码来源:TaskMgmtInstance.java


示例3: performAssignmentActorIdExpr

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
void performAssignmentActorIdExpr(String actorIdExpression, Assignable assignable, ExecutionContext executionContext)
{
  Object result = null;
  String actorId = null;
  try
  {
    result = JbpmExpressionEvaluator.evaluate(actorIdExpression, executionContext);
    if (result == null)
    {
      throw new JbpmException("actor-id expression '" + actorIdExpression + "' returned null");
    }
    actorId = (String)result;
  }
  catch (ClassCastException e)
  {
    throw new JbpmException("actor-id expression '" + actorIdExpression + "' didn't resolve to a java.lang.String: '" + result + "' ("
        + result.getClass().getName() + ")");
  }
  assignable.setActorId(actorId);
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:21,代码来源:TaskMgmtInstance.java


示例4: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public Object execute(JbpmContext jbpmContext) throws Exception {
	TaskInstance taskInstance = jbpmContext.getTaskInstance(id);
	ExecutionContext executionContext = new ExecutionContext(taskInstance.getToken());
	TaskInstance clone = taskInstance.getTaskMgmtInstance().createTaskInstance(
			taskInstance.getTask(),
			executionContext);
	clone.setSignalling(signalling);
	clone.setActorId(actorId, false);
	if (variables != null) {
		for (String codi: variables.keySet()) {
			clone.setVariableLocally(codi, variables.get(codi));
		}
	}
	
	// Desam logs únicament si està marcat al tipus d'expedient
	if (getAmbRetroaccio(jbpmContext, taskInstance.getProcessInstance()))
		jbpmContext.addAutoSaveTaskInstance(clone);
	
	return clone;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:21,代码来源:CloneTaskInstanceCommand.java


示例5: executeActions

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
void executeActions(List actions, ExecutionContext executionContext, boolean isPropagated) {
  if (actions != null) {
    Iterator iter = actions.iterator();
    while (iter.hasNext()) {
      Action action = (Action) iter.next();
      if (action.acceptsPropagatedEvents() || (!isPropagated)) {
        if (action.isAsync()) {
          ExecuteActionJob job = createAsyncActionExecutionJob(executionContext.getToken(), action);
          MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
          messageService.send(job);
        } else {
          executeAction(action, executionContext);
        }
      }
    }
  }
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:18,代码来源:GraphElement.java


示例6: isAbleToHandleExceptions

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
/**
 * Tells whether the given context is valid for exception handling by checking for:
 * <ul>
 * <li>the absence of a previous exception</li>
 * <li>an active transaction, or no transaction at all</li>
 * </ul>
 */
private static boolean isAbleToHandleExceptions(ExecutionContext executionContext) {
  /* if an exception is already set, we are already handling an exception;
   * in this case don't give the exception to the handlers but throw it to the client
   * see https://jira.jboss.org/jira/browse/JBPM-1887 */
  if (executionContext.getException() != null)
    return false;

  /* check whether the transaction is still active before scanning the exception handlers.
   * that way we can load the exception handlers lazily
   * see https://jira.jboss.org/jira/browse/JBPM-1775 */
  JbpmContext jbpmContext = executionContext.getJbpmContext();
  if (jbpmContext != null) {
    Services services = jbpmContext.getServices();
    if (services != null) {
      Service service = services.getPersistenceService();
      if (service instanceof DbPersistenceService) {
        DbPersistenceService persistenceService = (DbPersistenceService) service;
        return persistenceService.isTransactionActive() || persistenceService.getTransaction() == null;
      }
    }
  }

  // no transaction detected, probably running in memory only
  return true;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:33,代码来源:GraphElement.java


示例7: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	logger.debug("Inici execució handler generar document");
	String dc = (String)getValorOVariable(
			executionContext,
			documentCodi,
			varDocumentCodi);
	if (dc == null)
		throw new JbpmException("No s'ha especificat cap codi de document");
	Date docData = getValorOVariableData(executionContext, data, varData);
	if (docData == null)
		docData = new Date();
	Jbpm3HeliumBridge.getInstanceService().documentGenerarAmbPlantilla(
			null,
			getProcessInstanceId(executionContext),
			dc,
			docData);
	logger.debug("Handler generar document finalitzat amb èxit");
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:19,代码来源:DocumentGenerarHandler.java


示例8: consultaDomini

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
/**
 * Realitza una consulta a un domini
 * 
 * @param executionContext
 * @param codiDomini
 * @param parametres
 * @return
 */
public List<FilaResultat> consultaDomini(
		ExecutionContext executionContext,
		String codiDomini,
		String id,
		Map<String, Object> parametres) {
	List<FilaResultat> resposta = new ArrayList<FilaResultat>();
	List<DominiRespostaFilaDto> files = Jbpm3HeliumBridge.getInstanceService().dominiConsultar(
			getProcessInstanceId(executionContext),
			codiDomini,
			id,
			parametres);
	if (files != null) {
		for (DominiRespostaFilaDto fila: files) {
			FilaResultat fres = new FilaResultat();
			for (DominiRespostaColumnaDto columna: fila.getColumnes()) {
				fres.addColumna(
						new ParellaCodiValor(
								columna.getCodi(),
								columna.getValor()));
			}
			resposta.add(fres);
		}
	}
	return resposta;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:34,代码来源:BasicActionHandler.java


示例9: getValorOVariableInteger

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
protected Integer getValorOVariableInteger(
		ExecutionContext executionContext, Object value, String var) {
	if (value != null) {
		if (value instanceof Integer) {
			return (Integer) value;
		} else {
			return new Integer(value.toString());
		}
	}
	if (var != null && var.length() > 0) {
		Object valor = executionContext.getVariable(var);
		if (valor != null) {
			if (valor instanceof Integer) {
				return (Integer) valor;
			} else {
				return new Integer(valor.toString());
			}
		}
	}
	return null;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:22,代码来源:AbstractHeliumActionHandler.java


示例10: getDataInici

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
private Date getDataInici(ExecutionContext executionContext) {
	Date data;
	if (varData != null && varData.length() > 0) {
		data = getVariableComData(executionContext, varData);
	} else {
		data = new Date();
	}
	if (sumarUnDia != null && sumarUnDia.length() > 0) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(data);
		cal.add(Calendar.DAY_OF_MONTH, 1);
		return cal.getTime();
	} else {
		return data;
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:17,代码来源:TerminiCalcularDataFiHandler.java


示例11: getPersonesPas

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
private List<PersonaDto> getPersonesPas(ExecutionContext executionContext, int pas) {
	List<PersonaDto> resposta = null;
	String responsables = null;
	if (pas == 1) {
		responsables = (String)getValorOVariable(executionContext, pas1Responsables, varPas1Responsables);
	} else if (pas == 2) {
		responsables = (String)getValorOVariable(executionContext, pas2Responsables, varPas2Responsables);
	} else if (pas == 3) {
		responsables = (String)getValorOVariable(executionContext, pas3Responsables, varPas3Responsables);
	}
	if (responsables != null) {
		resposta = new ArrayList<PersonaDto>();
		String[] codis = responsables.split(",");
		for (String personaCodi: codis) {
			PersonaDto persona = Jbpm3HeliumBridge.getInstanceService().getPersonaAmbCodi(personaCodi.trim());
			if (persona != null)
				resposta.add(persona);
		}
	}
	return resposta;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:22,代码来源:PortasignaturesHandler.java


示例12: getDataFi

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
private Date getDataFi(ExecutionContext executionContext) {
	Date data;
	if (varData != null && varData.length() > 0) {
		data = getVariableComData(executionContext, varData);
	} else {
		data = new Date();
	}
	if (restarUnDia != null && restarUnDia.length() > 0) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(data);
		cal.add(Calendar.DAY_OF_MONTH, -1);
		return cal.getTime();
	} else {
		return data;
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:17,代码来源:TerminiCalcularDataIniciHandler.java


示例13: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	if (varTermini == null)
		throw new JbpmException("S'han d'especificar la variable a on guardar el termini");
	Integer a = getValorOVariableInteger(executionContext, anys, varAnys);
	Integer m = getValorOVariableInteger(executionContext, mesos, varMesos);
	Integer d = getValorOVariableInteger(executionContext, dies, varDies);
	if (a != null && m != null && d != null) {
		net.conselldemallorca.helium.jbpm3.integracio.Termini termini = new net.conselldemallorca.helium.jbpm3.integracio.Termini();
		termini.setAnys(a.intValue());
		termini.setMesos(m.intValue());
		termini.setDies(d.intValue());
		executionContext.setVariable(varTermini, termini);
	} else {
		throw new JbpmException("S'han d'especificar anys, mesos i dies");
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:17,代码来源:TerminiVariableGuardarHandler.java


示例14: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	String tc = (String)getValorOVariable(
			executionContext,
			terminiCodi,
			varTerminiCodi);
	TerminiIniciatDto terminiIniciat = Jbpm3HeliumBridge.getInstanceService().getTerminiIniciatAmbProcessInstanceITerminiCodi(
			getProcessInstanceId(executionContext),
			tc);
	if (terminiIniciat != null) {
		Timer timer = executionContext.getTimer();
		if (timer != null)
			timer.setDueDate(terminiIniciat.getDataFiAmbAturadaActual());
		TaskInstance taskInstance = executionContext.getTaskInstance();
		if (taskInstance != null)
			taskInstance.setDueDate(terminiIniciat.getDataFiAmbAturadaActual());
		Jbpm3HeliumBridge.getInstanceService().configurarTerminiIniciatAmbDadesJbpm(
				terminiIniciat.getId(),
				(taskInstance != null) ? new Long(taskInstance.getId()).toString() : null,
				(timer != null) ? new Long(timer.getId()) : null);
	} else {
		throw new JbpmException("No s'ha trobat cap termini iniciat (codi=" + tc + ")");
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:24,代码来源:ConfigurarAmbTerminiHandler.java


示例15: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	TerminiIniciatDto termini = getTerminiIniciatAmbCodi(
			executionContext,
			(String)getValorOVariable(executionContext, terminiCodi, varTerminiCodi));
	if (termini != null) {
		if (varData != null)
			Jbpm3HeliumBridge.getInstanceService().terminiPausar(
					termini.getId(),
					getVariableComData(executionContext, varData));
		else
			Jbpm3HeliumBridge.getInstanceService().terminiPausar(
					termini.getId(),
					new Date());
	} else {
		throw new JbpmException("No existeix cap termini iniciat amb aquest codi '" + terminiCodi + "'");
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:18,代码来源:TerminiPausarHandler.java


示例16: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	logger.debug("Inici execució handler modificació títol expedient");
	String t = (String)getValorOVariable(
			executionContext,
			titol,
			varTitol);
	ExpedientDto expedient = getExpedientActual(executionContext);
	logger.debug("Modificant títol de l'expedient (exp=" + expedient.getIdentificacioPerLogs() + ", titol=" + t + ")");
	try {
		Jbpm3HeliumBridge.getInstanceService().expedientModificarTitol(
				getProcessInstanceId(executionContext),
				t);
	} catch (Exception ex) {
		throw new JbpmException("Error al modificar l'expedient", ex);
	}
	logger.debug("Handler modificació títol finalitzat amb èxit");
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:18,代码来源:ExpedientTitolModificarHandler.java


示例17: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	logger.debug("Inici execució handler modificació estat expedient");
	String ec = (String)getValorOVariable(
			executionContext,
			estatCodi,
			varEstatCodi);
	ExpedientDto expedient = getExpedientActual(executionContext);
	String estatActualCodi = "null";
	if (expedient.getEstat() != null)
		estatActualCodi = expedient.getEstat().getCodi();
	logger.debug("Modificant estat de l'expedient (exp=" + expedient.getIdentificacioPerLogs() + ", estatActual=" + estatActualCodi + ", estatNou=" + ec + ")");
	try {
		Jbpm3HeliumBridge.getInstanceService().expedientModificarEstat(
				getProcessInstanceId(executionContext),
				ec);
	} catch (Exception ex) {
		throw new JbpmException("Error al modificar l'expedient", ex);
	}
	logger.debug("Handler modificació estat finalitzat amb èxit");
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:21,代码来源:ExpedientEstatModificarHandler.java


示例18: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	logger.debug("Inici execució handler modificació comentari expedient");
	String c = (String)getValorOVariable(
			executionContext,
			comentari,
			varComentari);
	ExpedientDto expedient = getExpedientActual(executionContext);
	logger.debug("Modificant comentari de l'expedient (exp=" + expedient.getIdentificacioPerLogs() + ", comentari=" + c + ")");
	try {
		Jbpm3HeliumBridge.getInstanceService().expedientModificarComentari(
				getProcessInstanceId(executionContext),
				c);
	} catch (Exception ex) {
		throw new JbpmException("Error al modificar l'expedient", ex);
	}
	logger.debug("Handler modificació de comentari finalitzat amb èxit");
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:18,代码来源:ExpedientComentariModificarHandler.java


示例19: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	logger.debug("Inici execució handler modificació número expedient");
	String n = (String)getValorOVariable(
			executionContext,
			numero,
			varNumero);
	ExpedientDto expedient = getExpedientActual(executionContext);
	ExpedientDto expedientRepetit = findExpedientAmbMateixTipusINumero(executionContext, n);
	if (expedientRepetit != null && expedientRepetit.getId().longValue() != expedient.getId().longValue())
		throw new JbpmException("Ja existeix un altre expedient d'aquest tipus amb el mateix número (" + n + ")");
	logger.debug("Modificant número de l'expedient (expedient=" + expedient.getIdentificacioPerLogs() + ", número=" + n + ")");
	try {
		Jbpm3HeliumBridge.getInstanceService().expedientModificarNumero(
				getProcessInstanceId(executionContext),
				n);
	} catch (Exception ex) {
		throw new JbpmException("Error al modificar l'expedient", ex);
	}
	logger.debug("Handler modificació número finalitzat amb èxit");
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:21,代码来源:ExpedientNumeroModificarHandler.java


示例20: execute

import org.jbpm.graph.exe.ExecutionContext; //导入依赖的package包/类
public void execute(ExecutionContext executionContext) throws Exception {
	logger.debug("Inici execució handler aturar expedient");
	String m = (String)getValorOVariable(
			executionContext,
			motiu,
			varMotiu);
	ExpedientDto expedient = getExpedientActual(executionContext);
	logger.debug("Aturant l'expedient (exp=" + expedient.getIdentificacioPerLogs() + ", motiu=" + m + ")");
	try {
		Jbpm3HeliumBridge.getInstanceService().expedientAturar(
				getProcessInstanceId(executionContext),
				m);
	} catch (Exception ex) {
		throw new JbpmException("Error al modificar l'expedient", ex);
	}
	logger.debug("Handler aturar expedient finalitzat amb èxit");
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:18,代码来源:ExpedientAturarHandler.java



注:本文中的org.jbpm.graph.exe.ExecutionContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DispatchHandlerFX类代码示例发布时间:2022-05-23
下一篇:
Java BuildableTextureAtlasTextureRegionFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap