[jboss-user] [EJB 3.0] - Re: JBoss 5 deployment error
jhsingle
do-not-reply at jboss.com
Wed Jan 7 14:37:43 EST 2009
I have posted a zip of the entire log at
http://rabasrv.jhuapl.edu/server.log.zip
The zip file is about 1 Meg and unzips to about 14 Meg. The first ClassNotFoundException occurs on line 31730.
There was one other bean with self-injection and I had changed that one also before my last post. Just to be sure, here's the code for WorkflowEngine with the self-injection removed:
| package workflow.ejb.server;
|
| import java.io.Serializable;
| import java.lang.reflect.Method;
| import java.util.ArrayList;
| import java.util.Date;
| import java.util.HashMap;
| import java.util.List;
| import java.util.Map;
|
| import javax.annotation.security.RolesAllowed;
| import javax.ejb.Local;
| import javax.ejb.Stateless;
| import javax.ejb.TransactionAttribute;
| import javax.ejb.TransactionAttributeType;
| import javax.ejb.TransactionManagement;
| import javax.ejb.TransactionManagementType;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
| import javax.persistence.Query;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jboss.ejb3.annotation.LocalBinding;
|
| import security.ejb.client.User;
| import workflow.ejb.client.ExecutionDetail;
| import workflow.ejb.client.ExecutionSummary;
| import workflow.ejb.client.ResultingParams;
| import workflow.ejb.client.StateDefinition;
| import workflow.ejb.client.StepDefinition;
| import workflow.ejb.client.TransitionDefinition;
| import workflow.ejb.client.TransitionReference;
| import workflow.ejb.client.WorkflowEngineLocal;
| import workflow.ejb.util.ParamUtil;
| import workflow.ejb.util.XPDLUtil;
|
| /**
| * Processes workflow. Uses Declaritive Transaction Mgmt for individual methods.
| */
| @Stateless
| @RolesAllowed( { "UNCLASSIFIED" })
| @LocalBinding(jndiBinding = "workflow/WorkflowEngine/local")
| @TransactionManagement(value = TransactionManagementType.CONTAINER)
| public class WorkflowEngine implements Serializable, WorkflowEngineLocal {
|
| /**
| * The class logger
| */
| private static Log logger = LogFactory.getLog(WorkflowEngine.class);
|
| /** workflow engine */
| // @javax.annotation.Resource(mappedName = "workflow/WorkflowEngine/local")
| // private WorkflowEngineLocal workflowEngineLocal;
|
| /**
| * The entity manager
| */
| protected @PersistenceContext(unitName = "workflow")
| EntityManager em;
|
| /**
| * Sets the execution summary id of the execution detail.
| *
| * @param executionSummaryId
| * @param executionDetailCopy
| */
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public void addExecutionDetailToExecutionSummary(long executionSummaryId,
| ExecutionDetail executionDetailCopy) {
|
| Query updateComplete = em
| .createNativeQuery("update EXECUTION_DETAIL set EX_SUMMARY_ID = :first where ID = :second");
|
| updateComplete.setParameter("first", executionSummaryId);
| updateComplete.setParameter("second", executionDetailCopy.getId());
| updateComplete.executeUpdate();
| }
|
| /**
| * Make sure that all transition definitions for a join have an associated
| * execution detail meaning that the join can proceed.
| *
| * @param tdList
| * @param esId
| * @return boolean
| */
| @SuppressWarnings("unchecked")
| public boolean areAllJoinTransitionsFinished(
| List<TransitionDefinition> tdList, long esId) {
|
| if (tdList == null) {
| logger.error("No transitions found for fork in execution summary: "
| + esId);
| return false;
| }
|
| for (TransitionDefinition td : tdList) {
|
| Query query = em
| .createQuery("from ExecutionDetail e "
| + " WHERE e.associatedStepId =:first AND e.executionSummaryId =:second AND e.completed =:third");
|
| query.setParameter("first", td.getId());
| query.setParameter("second", esId);
| query.setParameter("third", Long.parseLong("1"));
|
| List<ExecutionDetail> edList = query.getResultList();
| long edSize = edList.size();
|
| if (edSize < 1) {
| return false;
| }
| }
| return true;
| }
|
| /**
| * Checks if an execution detail exists for an execution summary and step
| * definition id.
| *
| * @param executionSummaryId
| * @param stepDefinitionId
| * @return int
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public int checkIfExecutionDetailExists(long executionSummaryId,
| long stepDefinitionId) {
| Query lockQuery = em
| .createNativeQuery("SELECT ID FROM EXECUTION_DETAIL WHERE EX_SUMMARY_ID = :first AND STEP_ID= :second ");
|
| lockQuery.setParameter("first", executionSummaryId);
| lockQuery.setParameter("second", stepDefinitionId);
|
| List results = lockQuery.getResultList();
| int noUpdate = 0;
| if (results != null && results.size() != 0) {
| noUpdate = 1;
| }
|
| return noUpdate;
| }
|
| /**
| * Creates a result params entry for an execution detail and execution
| * summary. This method does not insert the LOB, PARAMS_AS_XML.
| *
| * @param executionSummaryId
| * @param executionDetailId
| * @return int - number inserted
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public int createResultParams(long executionSummaryId,
| long executionDetailId) {
|
| // adding execution ids to entry and result param tables.
| Query insertRPQuery = em
| .createNativeQuery("INSERT INTO RESULTING_PARAMS(EX_DETAIL_ID,EX_SUMMARY_ID) "
| + " VALUES (:first,:second)");
| insertRPQuery.setParameter("first", executionDetailId);
| insertRPQuery.setParameter("second", executionSummaryId);
| int noInsert = insertRPQuery.executeUpdate();
|
| return noInsert;
| }
|
| /**
| * Get previous steps' execution params add the definition params.
| *
| * @param eSummaryId
| * @param edId
| * @param stateDef
| * @return params
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public Map<String, Object> getDefinitionParams(long eSummaryId, long edId,
| StateDefinition stateDef) {
|
| // get previous steps' execution params
| Map<String, Object> params = new HashMap<String, Object>();
|
| // add the definition params.
| params.putAll(stateDef.getParams());
|
| return params;
| }
|
| /**
| * Get Execution Detail based on execution summary and step definition. This
| * method is highly nested.
| *
| * @param executionSummaryId
| * The id of an ExecutionSummary
| * @param stepDefinitionId
| * The id of a StepDefinition
| * @return ExecutionDetail the execution detail for the associated
| * ExecutionSummary and StepDefinition.
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public ExecutionDetail getExecutionDetail(long executionSummaryId,
| long stepDefinitionId) {
|
| int noUpdate = checkIfExecutionDetailExists(
| executionSummaryId, stepDefinitionId);
|
| if (noUpdate == 0) {
| insertExecutionDetail(executionSummaryId,
| stepDefinitionId);
| }
|
| Query query = em
| .createQuery("from ExecutionDetail e WHERE e.executionSummaryId =:first AND e.associatedStepId =:second");
|
| // get execution detail of previous step.
| query.setParameter("first", executionSummaryId);
| query.setParameter("second", stepDefinitionId);
|
| // long edqtime = System.currentTimeMillis();
| List<ExecutionDetail> edList = query.getResultList();
|
| ExecutionDetail eDetail = null;
| // Add in the results in order.
| for (ExecutionDetail executionDetailFromQuery : edList) {
| eDetail = executionDetailFromQuery;
| }
|
| // adding execution ids to entry and result param tables.
| if (noUpdate == 0) {
| createResultParams(executionSummaryId, eDetail
| .getId());
| }
|
| return eDetail;
| }
|
| /**
| * Get the next TransitionDefinition for a fromState.
| *
| * @param stateDefId
| * @return TransitionDefinition
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public TransitionDefinition getNextTransitionDefinition(long stateDefId) {
| Query query = em
| .createQuery("from TransitionDefinition t WHERE t.fromState.id =:first ");
| query.setParameter("first", stateDefId);
|
| List<TransitionDefinition> edList = query.getResultList();
|
| TransitionDefinition td = null;
| if (edList != null && edList.size() > 0) {
| td = edList.get(0);
| }
|
| return td;
| }
|
| /**
| * Gets the resulting params for an execution detail.
| *
| * @param edId
| *
| * @param stepDefinition
| * a step definition
| * @param esId
| * Execution summary id
| * @return Map containing parameters
| */
|
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public Map<String, Object> getPersistedParams(long edId, long esId) {
|
| Query query = em
| .createQuery(
| "from ResultingParams rp WHERE rp.exSummaryId =:first AND rp.exDetailId =:second")
| .setHint("org.hibernate.readOnly", Boolean.TRUE);
|
| // get execution detail of previous step.
| query.setParameter("first", esId);
|
| query.setParameter("second", edId);
|
| List<ResultingParams> resultParamList = query.getResultList();
| Map<String, Object> params = new HashMap<String, Object>();
|
| if (resultParamList != null) {
| // Add in the results in order.
| for (ResultingParams resultParam : resultParamList) {
| params.putAll(ParamUtil.paramsAsXML(resultParam
| .getResultingParamsAsXML(), true));
| }
| }
|
| return params;
| }
|
| /**
| * Gets the params from the previous transition definition.
| *
| * @param eSummaryId
| * @param stateDef
| * @return runtimeParams
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public Map<String, Object> getRuntimeParams(long eSummaryId,
| StateDefinition stateDef) {
| Map<String, Object> runtimeParams = new HashMap<String, Object>();
|
| List<TransitionDefinition> transitionDefinitionList =
| getTransitionDefinitionsWithToId(stateDef.getId());
| for (TransitionDefinition td : transitionDefinitionList) {
|
| ExecutionDetail prevED = getExecutionDetail(
| eSummaryId, td.getFromState().getId());
| runtimeParams.putAll(getPersistedParams(prevED
| .getId(), eSummaryId));
| }
|
| return runtimeParams;
| }
|
| /**
| * Get TransitionDefinitions for a transitionReference id.
| *
| * @param transitionReferenceId
| * @return List of TransitionDefinitionS
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public List<TransitionDefinition> getTransitionDefinitions(
| long transitionReferenceId) {
|
| Query fetchTQuery = em
| .createQuery(
| "from TransitionDefinition td WHERE td.transitionReference.id =:first")
| .setHint("org.hibernate.readOnly", Boolean.TRUE);
| fetchTQuery.setParameter("first", transitionReferenceId);
| List<TransitionDefinition> transitionDefinitionList = fetchTQuery
| .getResultList();
| if (transitionDefinitionList != null) {
|
| }
| return transitionDefinitionList;
| }
|
| /**
| * Get TransitionDefinitions for a toState id.
| *
| * @param toStateDefId
| * @return List of TransitionDefinitionS
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public List<TransitionDefinition> getTransitionDefinitionsWithToId(
| long toStateDefId) {
|
| Query fetchTQuery = em.createQuery(
| "from TransitionDefinition td WHERE td.toState.id =:first")
| .setHint("org.hibernate.readOnly", Boolean.TRUE);
| fetchTQuery.setParameter("first", toStateDefId);
|
| List<TransitionDefinition> tdList = new ArrayList<TransitionDefinition>();
| try {
|
| List<TransitionDefinition> tempTdList = fetchTQuery.getResultList();
| if (tempTdList != null && tempTdList.size() > 0) {
| tdList = getTransitionDefinitions(tempTdList.get(0)
| .getTransitionReference().getId());
| }
| } catch (javax.persistence.NoResultException e) {
| logger.error("No transition defs found with " + toStateDefId
| + " as a 'To' state.", e);
| }
|
| return tdList;
| }
|
| /**
| * Handle action for a state definition.
| *
| * @param stateDefinition
| * a state Definition
| * @param definitionParams
| * @param runtimeParams
| * @param params
| * The state parameters
| * @param user
| * a User
| * @return a Map<String, Object> the results of a action class method
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public Map<String, Object> handleAction(StateDefinition stateDefinition,
| Map<String, Object> definitionParams,
| Map<String, Object> runtimeParams, User user) {
| Map<String, Object> retmap = null;
| try {
|
| definitionParams.put("user", user);
|
| Class c = Class.forName(stateDefinition.getActionClass());
| Class[] argClasses = new Class[3];
| argClasses[0] = StateDefinition.class;
| argClasses[1] = Map.class;
| argClasses[2] = Map.class;
| Method mymethod = c.getMethod(stateDefinition.getActionMethod(),
| argClasses);
| Object[] args = new Object[3];
| args[0] = stateDefinition;
| args[1] = definitionParams;
| args[2] = runtimeParams;
| Object obj = c.newInstance();
| retmap = (Map<String, Object>) mymethod.invoke(obj, args);
| } catch (Exception e) {
| logger.error("An error occured while running an algorithm", e);
| throw new RuntimeException(
| "An error occured while running an algorithm");
| }
| return retmap;
| }
|
| /**
| * Create execution detail.
| *
| * @param executionSummaryId
| * @param stepDefinitionId
| * @return number inserted
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public int insertExecutionDetail(long executionSummaryId,
| long stepDefinitionId) {
|
| Query insertQuery = em
| .createNativeQuery("INSERT INTO EXECUTION_DETAIL(EX_SUMMARY_ID, STEP_ID) "
| + " VALUES (:first, :second)");
|
| insertQuery.setParameter("first", executionSummaryId);
| insertQuery.setParameter("second", stepDefinitionId);
| int noInsert = insertQuery.executeUpdate();
| return noInsert;
| }
|
| /**
| * Send message to queue.
| *
| * @param eSummaryId
| * @param tdId
| * @param user
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void postMessageForNextStep(long eSummaryId, long tdId, User user) {
| WorkflowUtil.sendMessage(WorkflowManager.queueName, tdId, user,
| eSummaryId);
| }
|
| /**
| * Get the ExecutionDetail,StepDefinition,ExecutionSummary and process the
| * next step.
| *
| * @param eSummaryId
| * @param stepDefId
| * @param user
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void process(long eSummaryId, long stepDefId, User user) {
|
| // get objects by their id.
| ExecutionDetail executionDetail =
| getExecutionDetail(eSummaryId, stepDefId);
| StepDefinition stepDefinition = em
| .find(StepDefinition.class, stepDefId);
| ExecutionSummary executionSummary = em.find(ExecutionSummary.class,
| eSummaryId);
|
| // if all needed objects were found, process this step
| if (executionSummary != null
| && executionSummary.getWhenCompleted() == null
| && stepDefinition != null) {
| processStep(executionSummary, stepDefinition,
| executionDetail, user);
| }
| }
|
| /**
| * Process a FORK step.
| *
| * @param eDetail
| * @param tDef
| * @param tRef
| * @param eSummaryId
| * @param user
| */
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void processFork(ExecutionDetail eDetail, TransitionDefinition tDef,
| TransitionReference tRef, long eSummaryId, User user) {
|
| // place all transitions into queue. Since each will get called
| // do the same thing as a
| // series. We just don't have a condition.
| eDetail.setActionClassCalled("FORK");
|
| List<TransitionDefinition> transitionDefinitionList =
| getTransitionDefinitions(tRef.getId());
|
| for (TransitionDefinition td : transitionDefinitionList) {
|
| setExecutionDetailCompleted(eDetail);
|
| postMessageForNextStep(eSummaryId, td
| .getToState().getId(), user);
|
| }
|
| }
|
| /**
| * Process a JOIN step.
| *
| * @param eDetail
| * @param tDef
| * @param tRef
| * @param eSummaryId
| * @param user
| */
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public void processJoin(ExecutionDetail eDetail, TransitionDefinition tDef,
| TransitionReference tRef, long eSummaryId, User user) {
|
| List<TransitionDefinition> transitionDefinitionList =
| getTransitionDefinitions(tRef.getId());
|
| setExecutionDetailCompleted(eDetail);
|
| if (areAllJoinTransitionsFinished(
| transitionDefinitionList, eSummaryId)) {
| postMessageForNextStep(eSummaryId, tDef
| .getToState().getId(), user);
| }
|
| }
|
| /**
| *
| * @see workflow.ejb.client.WorkflowEngineLocal#processLoop(long,
| * workflow.ejb.client.ExecutionDetail,
| * workflow.ejb.client.StateDefinition, security.ejb.client.User)
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void processLoop(long eSummaryId, ExecutionDetail eDetail,
| StateDefinition stateDef, User user) {
| String interval = Long.toString(stateDef.getLoopInterval());
| if (!interval.contains(".")) {
| interval = interval + ".0";
| }
|
| try {
| if (stateDef.getWhenToTest().equalsIgnoreCase("before")) {
|
| for (; stateDef.getLoopCounter() < stateDef.getLoopMaximum(); stateDef
| .setLoopCounter(stateDef.getLoopCounter() + 1)) {
| processStateAlgorithm(eSummaryId, eDetail.getId(),
| stateDef, user);
| Thread.sleep(stateDef.getLoopInterval());
| }
| }
| // whenToTest is assumed to be "after"
| else {
|
| do {
| processStateAlgorithm(eSummaryId, eDetail.getId(),
| stateDef, user);
| stateDef.setLoopCounter(stateDef.getLoopCounter() + 1);
| Thread.sleep(stateDef.getLoopInterval());
| } while (stateDef.getLoopCounter() < stateDef.getLoopMaximum());
| }
| } catch (InterruptedException e) {
| logger.error("Interruption exception received. ", e);
| }
|
| }
|
| /**
| * Process a SERIES.
| *
| * @param eSummaryId
| * @param tDef
| * @param eDetail
| * @param user
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void processSeries(long eSummaryId, TransitionDefinition tDef,
| ExecutionDetail eDetail, User user) {
|
| ExecutionDetail prevED = getExecutionDetail(
| eSummaryId, tDef.getFromState().getId());
| Map<String, Object> params = getPersistedParams(
| prevED.getId(), eSummaryId);
|
| // evaluate condition to move to next state.
| boolean res = tDef.getConditionForEval() == null ? true : XPDLUtil
| .evaluateCondition(tDef.getConditionForEval(), params);
| if (res) {
| // move to the next state.
| eDetail = getExecutionDetail(eSummaryId, tDef
| .getId());
|
| setExecutionDetailCompleted(eDetail);
|
| postMessageForNextStep(eSummaryId, tDef
| .getToState().getId(), user);
| }
| }
|
| /**
| * Runs the algorithm.
| *
| * @param eSummary
| * @param stateDef
| * @param eDetail
| * @param user
| * @param em
| */
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public void processStateDefinition(ExecutionSummary eSummary,
| StateDefinition stateDef, ExecutionDetail eDetail, User user) {
|
| try {
| boolean hasLoop = (stateDef.getLoopMaximum() > 0);
|
| if (hasLoop) {
| processLoop(eSummary.getId(), eDetail, stateDef, user);
| } else {
| processStateAlgorithm(eSummary.getId(), eDetail.getId(),
| stateDef, user);
| }
|
| TransitionDefinition td =
| getNextTransitionDefinition(stateDef.getId());
|
| // finished state processing
| setExecutionDetailCompleted(eDetail);
|
| if (td != null) {
| // follow next transition
| postMessageForNextStep(eSummary.getId(), td
| .getId(), user);
| return;
| } else {
| endWorkflow(eSummary);
| }
| } catch (Exception e) {
| endWorkflowInError(eSummary, eDetail);
| logger.debug(e.toString());
| }
| }
|
| /**
| *
| * @see workflow.ejb.client.WorkflowEngineLocal#endWorkflow(workflow.ejb.client.ExecutionSummary)
| */
| public void endWorkflow(ExecutionSummary eSummary) {
| // end workflow
| Date completed = new Date();
|
| eSummary.setWhenCompleted(completed);
|
| Query updateComplete = em
| .createNativeQuery("update EXECUTION_SUMMARY set WHEN_COMPLETED = :first where ID = :second");
|
| updateComplete.setParameter("first", completed);
| updateComplete.setParameter("second", eSummary.getId());
| updateComplete.executeUpdate();
| }
|
| /**
| *
| * @see workflow.ejb.client.WorkflowEngineLocal#endWorkflowInError(workflow.ejb.client.ExecutionSummary,
| * workflow.ejb.client.ExecutionDetail)
| */
| public void endWorkflowInError(ExecutionSummary eSummary,
| ExecutionDetail eDetail) {
| setExecutionDetailCompleted(eDetail);
| endWorkflow(eSummary);
| }
|
| /**
| * Process the state algorithm
| *
| * @param eSummaryId
| * Summary ID
| * @param eDetailId
| * Detail ID
| * @param stateDef
| * State definition
| * @param user
| * User
| */
| private void processStateAlgorithm(long eSummaryId, long eDetailId,
| StateDefinition stateDef, User user) {
| // get params needed to process step
| Map<String, Object> defParams =
| getDefinitionParams(eSummaryId, eDetailId, stateDef);
|
| Map<String, Object> runtimeParams = new HashMap<String, Object>();
|
| List<TransitionDefinition> transitionDefinitionList =
| getTransitionDefinitionsWithToId(stateDef.getId());
| for (TransitionDefinition td : transitionDefinitionList) {
|
| ExecutionDetail prevED = getExecutionDetail(
| eSummaryId, td.getFromState().getId());
| runtimeParams.putAll(getPersistedParams(prevED
| .getId(), eSummaryId));
| }
|
| // run the algorithm
| if (stateDef.getActionClass() != null
| && stateDef.getActionClass().length() > 0) {
| Map<String, Object> resultMap = handleAction(
| stateDef, defParams, runtimeParams, user);
|
| updatePersistedResultParams(eDetailId,
| eSummaryId, resultMap);
| } else // must be a fork or join state
| {
| updatePersistedResultParams(eDetailId,
| eSummaryId, runtimeParams);
| }
| }
|
| /**
| * Process step.
| *
| * @param executionSummary
| * an ExecutionSummary
| * @param stepDefinition
| * a StateDefinition
| * @param executionDetail
| * an executionDetail
| * @param user
| * a User
| * @param params
| */
|
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void processStep(ExecutionSummary executionSummary,
| StepDefinition stepDefinition, ExecutionDetail executionDetail,
| User user) {
|
| if (stepDefinition instanceof StateDefinition) {
| StateDefinition stateDef = (StateDefinition) stepDefinition;
| processStateDefinition(executionSummary,
| stateDef, executionDetail, user);
| } else if (stepDefinition instanceof TransitionDefinition) {
| processTransitionDefinition(executionSummary,
| (TransitionDefinition) stepDefinition, executionDetail,
| user);
| } else {
| logger.error("Cannot understand what to process for step with id="
| + stepDefinition.getId());
| throw new RuntimeException(
| "Cannot understand what to process for step with id="
| + stepDefinition.getId());
| }
| addExecutionDetailToExecutionSummary(
| executionSummary.getId(), executionDetail);
| }
|
| /**
| * Process a TransitionDefinition.
| *
| * @param eSummary
| * @param tDef
| * @param eDetail
| * @param user
| */
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void processTransitionDefinition(ExecutionSummary eSummary,
| TransitionDefinition tDef, ExecutionDetail eDetail, User user) {
|
| TransitionReference tRef = tDef.getTransitionReference();
|
| if (tRef.getTransitionType() == TransitionReference.FORK) {
| processFork(eDetail, tDef, tRef, eSummary
| .getId(), user);
| } else if (tRef.getTransitionType() == TransitionReference.JOIN) {
| processJoin(eDetail, tDef, tRef, eSummary
| .getId(), user);
| } else if (tRef.getTransitionType() == TransitionReference.SERIES) {
| processSeries(eSummary.getId(), tDef, eDetail,
| user);
|
| } else {
| logger.error("Transition type " + tRef.getTransitionType()
| + "is not understood.");
| throw new RuntimeException("Transition type "
| + tRef.getTransitionType() + "is not understood.");
| }
| }
|
| /**
| * Sets an ExecutionDetail as completed.
| *
| * @param eDetail
| * @return number updated
| */
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public int setExecutionDetailCompleted(ExecutionDetail eDetail) {
|
| Query completed = em
| .createNativeQuery("UPDATE EXECUTION_DETAIL SET COMPLETED = '1' WHERE ID = :first");
| completed.setParameter("first", eDetail.getId());
| int numUpdated = completed.executeUpdate();
| eDetail.setCompleted(1);
|
| return numUpdated;
| }
|
| /**
| * Updates the LOB, PARAMS_AS_XML.
| *
| * @param edId
| * @param esId
| * @param params
| */
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public void updatePersistedResultParams(long edId, long esId,
| Map<String, Object> params) {
|
| Query updateResultParamsQuery = em
| .createNativeQuery("UPDATE RESULTING_PARAMS SET RESULTING_PARAMS_AS_XML = :first WHERE EX_DETAIL_ID = :second");
|
| updateResultParamsQuery.setParameter("first", ParamUtil.paramsFromMap(
| params, true));
| updateResultParamsQuery.setParameter("second", edId);
| updateResultParamsQuery.executeUpdate();
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200171#4200171
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200171
More information about the jboss-user
mailing list