本文整理汇总了Java中org.kuali.rice.kew.service.KEWServiceLocator.getSimulationEngine方法的典型用法代码示例。如果您正苦于以下问题:Java KEWServiceLocator.getSimulationEngine方法的具体用法?Java KEWServiceLocator.getSimulationEngine怎么用?Java KEWServiceLocator.getSimulationEngine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.service.KEWServiceLocator
的用法示例。
在下文中一共展示了KEWServiceLocator.getSimulationEngine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: report
import org.kuali.rice.kew.service.KEWServiceLocator; //导入方法依赖的package包/类
public DocumentRouteHeaderValue report(SimulationCriteria criteria) {
try {
SimulationWorkflowEngine simulationEngine = KEWServiceLocator.getSimulationEngine();
SimulationResults results = simulationEngine.runSimulation(criteria);
return materializeDocument(results);
} catch (Exception e) {
if (e instanceof RuntimeException) {
throw (RuntimeException)e;
}
throw new IllegalStateException("Problem running report: " + e.getMessage(), e);
}
}
示例2: documentWillHaveAtLeastOneActionRequest
import org.kuali.rice.kew.service.KEWServiceLocator; //导入方法依赖的package包/类
@Override
public boolean documentWillHaveAtLeastOneActionRequest(RoutingReportCriteria reportCriteria, List<String> actionRequestedCodes, boolean ignoreCurrentActionRequests) {
incomingParamCheck(reportCriteria, "reportCriteria");
incomingParamCheck(actionRequestedCodes, "actionRequestedCodes");
try {
SimulationWorkflowEngine simulationEngine = KEWServiceLocator.getSimulationEngine();
SimulationCriteria criteria = SimulationCriteria.from(reportCriteria);
// set activate requests to true by default so force action works correctly
criteria.setActivateRequests(Boolean.TRUE);
SimulationResults results = simulationEngine.runSimulation(criteria);
List<ActionRequestValue> actionRequestsToProcess = results.getSimulatedActionRequests();
if (!ignoreCurrentActionRequests) {
actionRequestsToProcess.addAll(results.getDocument().getActionRequests());
}
for (ActionRequestValue actionRequest : actionRequestsToProcess) {
if (actionRequest.isDone()) {
// an action taken has eliminated this request from being active
continue;
}
// if no action request codes are passed in.... assume any request found is
if (CollectionUtils.isEmpty(actionRequestedCodes) ) {
// we found an action request
return true;
}
// check the action requested codes passed in
for (String requestedActionRequestCode : actionRequestedCodes) {
if (requestedActionRequestCode.equals(actionRequest.getActionRequested())) {
boolean satisfiesDestinationUserCriteria = (criteria.getDestinationRecipients().isEmpty()) || (isRecipientRoutedRequest(actionRequest,criteria.getDestinationRecipients()));
if (satisfiesDestinationUserCriteria) {
if (StringUtils.isBlank(criteria.getDestinationNodeName())) {
return true;
} else if (StringUtils.equals(criteria.getDestinationNodeName(),actionRequest.getNodeInstance().getName())) {
return true;
}
}
}
}
}
return false;
} catch (Exception ex) {
String error = "Problems evaluating documentWillHaveAtLeastOneActionRequest: " + ex.getMessage();
LOG.error(error,ex);
if (ex instanceof RuntimeException) {
throw (RuntimeException)ex;
}
throw new RuntimeException(error, ex);
}
}
示例3: isUserInRouteLogWithOptionalFlattening
import org.kuali.rice.kew.service.KEWServiceLocator; //导入方法依赖的package包/类
@Override
public boolean isUserInRouteLogWithOptionalFlattening(String documentId, String principalId, boolean lookFuture, boolean flattenNodes) {
incomingParamCheck(documentId, "documentId");
incomingParamCheck(principalId, "principalId");
boolean authorized = false;
if ( LOG.isDebugEnabled() ) {
LOG.debug("Evaluating isUserInRouteLog [docId=" + documentId + ", principalId=" + principalId + ", lookFuture=" + lookFuture + "]");
}
DocumentRouteHeaderValue routeHeader = loadDocument(documentId);
if (routeHeader == null) {
throw new IllegalArgumentException("Document for documentId: " + documentId + " does not exist");
}
Principal principal = KEWServiceLocator.getIdentityHelperService().getPrincipal(principalId);
if (principal == null) {
throw new IllegalArgumentException("Principal for principalId: " + principalId + " does not exist");
}
List<ActionTakenValue> actionsTaken = KEWServiceLocator.getActionTakenService().findByDocumentIdPrincipalId(documentId, principal.getPrincipalId());
if(routeHeader.getInitiatorWorkflowId().equals(principal.getPrincipalId())){
return true;
}
if (!actionsTaken.isEmpty()) {
LOG.debug("found action taken by user");
authorized = true;
}
List<ActionRequestValue> actionRequests = KEWServiceLocator.getActionRequestService().findAllActionRequestsByDocumentId(documentId);
if (actionRequestListHasPrincipal(principal, actionRequests)) {
authorized = true;
}
if (!lookFuture || authorized) {
return authorized;
}
SimulationWorkflowEngine simulationEngine = KEWServiceLocator.getSimulationEngine();
SimulationCriteria criteria = SimulationCriteria.createSimulationCritUsingDocumentId(documentId);
criteria.setDestinationNodeName(null); // process entire document to conclusion
criteria.getDestinationRecipients().add(new KimPrincipalRecipient(principal));
criteria.setFlattenNodes(flattenNodes);
try {
SimulationResults results = simulationEngine.runSimulation(criteria);
if (actionRequestListHasPrincipal(principal, results.getSimulatedActionRequests())) {
authorized = true;
}
} catch (Exception e) {
throw new RiceRuntimeException(e);
}
return authorized;
}