本文整理汇总了Java中org.kuali.rice.kew.api.action.WorkflowDocumentActionsService类的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocumentActionsService类的具体用法?Java WorkflowDocumentActionsService怎么用?Java WorkflowDocumentActionsService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkflowDocumentActionsService类属于org.kuali.rice.kew.api.action包,在下文中一共展示了WorkflowDocumentActionsService类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWorkflowDocumentActionsService
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
/**
* Helper method to get the correct {@link WorkflowDocumentActionsService} from the {@code applicationId} of the
* document type.
*
* @param documentTypeId the document type to get the application id from
*
* @return the correct {@link WorkflowDocumentActionsService} from the {@code applicationId} of the document type
*/
protected WorkflowDocumentActionsService getWorkflowDocumentActionsService(String documentTypeId) {
DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeById(documentTypeId);
String applicationId = documentType.getApplicationId();
QName serviceName = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0,
KewApiConstants.ServiceNames.WORKFLOW_DOCUMENT_ACTIONS_SERVICE_SOAP);
WorkflowDocumentActionsService service = (WorkflowDocumentActionsService) KsbApiServiceLocator.getServiceBus()
.getService(serviceName, applicationId);
if (service == null) {
service = KewApiServiceLocator.getWorkflowDocumentActionsService();
}
return service;
}
示例2: superUserDisapprove
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward superUserDisapprove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
KualiDocumentFormBase documentForm = (KualiDocumentFormBase)form;
if(StringUtils.isBlank(documentForm.getSuperUserAnnotation())) {
GlobalVariables.getMessageMap().putErrorForSectionId("superuser.errors", "superuser.disapprove.annotation.missing", "");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
} else if (!documentForm.getSelectedActionRequests().isEmpty()) {
GlobalVariables.getMessageMap().putErrorForSectionId("superuser.errors", "superuser.disapprove.when.actions.checked", "");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
} else if (!documentForm.isStateAllowsApproveOrDisapprove()) {
GlobalVariables.getMessageMap().putErrorForSectionId("superuser.errors", "superuser.disapprove.not.allowed", "");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentForm.getWorkflowDocument().getDocumentTypeId());
DocumentActionParameters parameters = DocumentActionParameters.create(documentForm.getDocId(), GlobalVariables.getUserSession().getPrincipalId(), documentForm.getSuperUserAnnotation());
documentActions.superUserDisapprove(parameters, true);
GlobalVariables.getMessageMap().putInfo("document", "general.routing.superuser.disapproved", documentForm.getDocId());
documentForm.setSuperUserAnnotation("");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例3: superUserApprove
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward superUserApprove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
KualiDocumentFormBase documentForm = (KualiDocumentFormBase)form;
if(StringUtils.isBlank(documentForm.getSuperUserAnnotation())) {
GlobalVariables.getMessageMap().putErrorForSectionId("superuser.errors", "superuser.approve.annotation.missing", "");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
} else if (!documentForm.getSelectedActionRequests().isEmpty()) {
GlobalVariables.getMessageMap().putErrorForSectionId("superuser.errors", "superuser.approve.when.actions.checked", "");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
} else if (!documentForm.isStateAllowsApproveOrDisapprove()) {
GlobalVariables.getMessageMap().putErrorForSectionId("superuser.errors", "superuser.approve.not.allowed", "");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentForm.getWorkflowDocument().getDocumentTypeId());
DocumentActionParameters parameters = DocumentActionParameters.create(documentForm.getDocId(), GlobalVariables.getUserSession().getPrincipalId(), documentForm.getSuperUserAnnotation());
documentActions.superUserBlanketApprove(parameters, true);
GlobalVariables.getMessageMap().putInfo("document", "general.routing.superuser.approved", documentForm.getDocId());
documentForm.setSuperUserAnnotation("");
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例4: routeLevelApprove
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward routeLevelApprove(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
LOG.info("entering routeLevelApprove()...");
SuperUserForm superUserForm = (SuperUserForm) form;
String documentId = superUserForm.getRouteHeader().getDocumentId();
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentId);
DocumentActionParameters parameters = DocumentActionParameters.create(documentId, getUserSession(request)
.getPrincipalId(), superUserForm.getAnnotation());
documentActions.superUserNodeApprove(parameters, superUserForm.isRunPostProcessorLogic(),
superUserForm.getDestNodeName());
saveDocumentMessage("general.routing.superuser.routeLevelApproved", request, superUserForm.getDocumentId(),
null);
LOG.info("exiting routeLevelApprove()...");
superUserForm.getActionRequests().clear();
initForm(request, form);
return defaultDispatch(mapping, form, request, response);
}
示例5: returnToPreviousNode
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward returnToPreviousNode(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
LOG.info("entering returnToPreviousNode() ...");
SuperUserForm superUserForm = (SuperUserForm) form;
String documentId = superUserForm.getRouteHeader().getDocumentId();
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentId);
DocumentActionParameters parameters = DocumentActionParameters.create(documentId, getUserSession(request)
.getPrincipalId(), superUserForm.getAnnotation());
documentActions.superUserReturnToPreviousNode(parameters, superUserForm.isRunPostProcessorLogic(),
ReturnPoint.create(superUserForm.getReturnDestNodeName()));
saveDocumentMessage("general.routing.returnedToPreviousNode", request, "document", superUserForm
.getReturnDestNodeName().toString());
LOG.info("exiting returnToPreviousRouteLevel() ...");
superUserForm.getActionRequests().clear();
initForm(request, form);
return defaultDispatch(mapping, form, request, response);
}
示例6: getWorkflowDocumentActionsService
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public static WorkflowDocumentActionsService getWorkflowDocumentActionsService() {
RunMode kewRunMode = RunMode.valueOf(ConfigContext.getCurrentContextConfig().getProperty(KEW_RUN_MODE_PROPERTY));
if (kewRunMode == RunMode.REMOTE || kewRunMode == RunMode.THIN) {
String standaloneApplicationId = ConfigContext.getCurrentContextConfig().getProperty(STANDALONE_APPLICATION_ID);
return getWorkflowDocumentActionsService(standaloneApplicationId);
} else {
return getService(WORKFLOW_DOCUMENT_ACTIONS_SERVICE);
}
}
示例7: getWorkflowDocumentActionsService
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
private WorkflowDocumentActionsService getWorkflowDocumentActionsService(String documentTypeId) {
DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeById(documentTypeId);
String applicationId = documentType.getApplicationId();
QName serviceName = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0,
KewApiConstants.ServiceNames.WORKFLOW_DOCUMENT_ACTIONS_SERVICE_SOAP);
WorkflowDocumentActionsService service = (WorkflowDocumentActionsService) KsbApiServiceLocator.getServiceBus()
.getService(serviceName, applicationId);
if (service == null) {
service = KewApiServiceLocator.getWorkflowDocumentActionsService();
}
return service;
}
示例8: approve
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward approve(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
LOG.info("entering approve() ...");
SuperUserForm superUserForm = (SuperUserForm) form;
String documentId = superUserForm.getRouteHeader().getDocumentId();
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentId);
DocumentActionParameters parameters = DocumentActionParameters.create(documentId, getUserSession(request)
.getPrincipalId(), superUserForm.getAnnotation());
documentActions.superUserBlanketApprove(parameters, superUserForm.isRunPostProcessorLogic());
saveDocumentMessage("general.routing.superuser.approved", request, superUserForm.getDocumentId(), null);
LOG.info("exiting approve() ...");
superUserForm.getActionRequests().clear();
initForm(request, form);
return defaultDispatch(mapping, form, request, response);
}
示例9: disapprove
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward disapprove(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
LOG.info("entering disapprove() ...");
SuperUserForm superUserForm = (SuperUserForm) form;
String documentId = superUserForm.getRouteHeader().getDocumentId();
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentId);
DocumentActionParameters parameters = DocumentActionParameters.create(documentId, getUserSession(request)
.getPrincipalId(), superUserForm.getAnnotation());
documentActions.superUserDisapprove(parameters, superUserForm.isRunPostProcessorLogic());
saveDocumentMessage("general.routing.superuser.disapproved", request, superUserForm.getDocumentId(), null);
LOG.info("exiting disapprove() ...");
superUserForm.getActionRequests().clear();
initForm(request, form);
return defaultDispatch(mapping, form, request, response);
}
示例10: cancel
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
LOG.info("entering cancel() ...");
SuperUserForm superUserForm = (SuperUserForm) form;
String documentId = superUserForm.getRouteHeader().getDocumentId();
WorkflowDocumentActionsService documentActions = getWorkflowDocumentActionsService(documentId);
DocumentActionParameters parameters = DocumentActionParameters.create(documentId, getUserSession(request)
.getPrincipalId(), superUserForm.getAnnotation());
documentActions.superUserCancel(parameters, superUserForm.isRunPostProcessorLogic());
saveDocumentMessage("general.routing.superuser.canceled", request, superUserForm.getDocumentId(), null);
LOG.info("exiting cancel() ...");
superUserForm.getActionRequests().clear();
initForm(request, form);
return defaultDispatch(mapping, form, request, response);
}
示例11: getWorkflowDocumentActionsService
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
private WorkflowDocumentActionsService getWorkflowDocumentActionsService(String documentId) {
DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByDocumentId(documentId);
String applicationId = documentType.getApplicationId();
QName serviceName = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0,
KewApiConstants.ServiceNames.WORKFLOW_DOCUMENT_ACTIONS_SERVICE_SOAP);
WorkflowDocumentActionsService service = (WorkflowDocumentActionsService) KsbApiServiceLocator.getServiceBus()
.getService(serviceName, applicationId);
if (service == null) {
service = KewApiServiceLocator.getWorkflowDocumentActionsService();
}
return service;
}
示例12: testIsUserInRouteLog
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
@Test
public void testIsUserInRouteLog() throws Exception {
WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), SeqSetup.DOCUMENT_TYPE_NAME);
document.route("");
assertTrue(document.isEnroute());
WorkflowDocumentActionsService wdas = KewApiServiceLocator.getWorkflowDocumentActionsService();
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("ewestfal"), false));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("bmcgough"), false));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("rkirkend"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("pmckown"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("temay"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("jhopf"), false));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("pmckown"), true));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("temay"), true));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("jhopf"), true));
// test that we can run isUserInRouteLog on a SAVED document
document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), SeqSetup.DOCUMENT_TYPE_NAME);
document.saveDocument("");
assertTrue(document.isSaved());
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("ewestfal"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("bmcgough"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("rkirkend"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("pmckown"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("temay"), false));
assertFalse("User should not be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("jhopf"), false));
// now look all up in the future of this saved document
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("bmcgough"), true));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("rkirkend"), true));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("pmckown"), true));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("temay"), true));
assertTrue("User should be authenticated.", wdas.isUserInRouteLog(document.getDocumentId(), getPrincipalIdForName("jhopf"), true));
}
示例13: testRoutingReportOnDocumentType
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
@Test public void testRoutingReportOnDocumentType() throws Exception {
RoutingReportCriteria.Builder criteria = RoutingReportCriteria.Builder.createByDocumentTypeName("SeqDocType");
criteria.setRuleTemplateNames(Collections.singletonList("WorkflowDocumentTemplate"));
WorkflowDocumentActionsService wdas = KewApiServiceLocator.getWorkflowDocumentActionsService();
DocumentDetail documentDetail = wdas.executeSimulation(criteria.build());
assertNotNull(documentDetail);
assertEquals("Should have been 2 requests generated.", 2, documentDetail.getActionRequests().size());
// let's try doing both WorkflowDocumentTemplate and WorkflowDocumentTemplate2 together
criteria.setRuleTemplateNames(Arrays.asList(new String[] {"WorkflowDocumentTemplate", "WorkflowDocument2Template"}));
documentDetail = wdas.executeSimulation(criteria.build());
assertEquals("Should have been 3 requests generated.", 3, documentDetail.getActionRequests().size());
boolean foundRkirkend = false;
boolean foundBmcgough = false;
boolean foundPmckown = false;
for (ActionRequest actionRequest : documentDetail.getActionRequests()) {
String netId = getPrincipalNameForId(actionRequest.getPrincipalId());
if (netId.equals("rkirkend")) {
foundRkirkend = true;
assertEquals(SeqSetup.WORKFLOW_DOCUMENT_NODE, actionRequest.getNodeName());
} else if (netId.equals("bmcgough")) {
foundBmcgough = true;
assertEquals(SeqSetup.WORKFLOW_DOCUMENT_NODE, actionRequest.getNodeName());
} else if (netId.equals("pmckown")) {
foundPmckown = true;
assertEquals(SeqSetup.WORKFLOW_DOCUMENT_2_NODE, actionRequest.getNodeName());
}
}
assertTrue("Did not find request for rkirkend", foundRkirkend);
assertTrue("Did not find request for bmcgough", foundBmcgough);
assertTrue("Did not find request for pmckown", foundPmckown);
}
示例14: testRoutingReportOnDocumentId
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; //导入依赖的package包/类
@Test public void testRoutingReportOnDocumentId() throws Exception {
WorkflowDocument doc = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("user1"), "SeqDocType");
WorkflowDocumentActionsService wdas = KewApiServiceLocator.getWorkflowDocumentActionsService();
RoutingReportCriteria.Builder criteria = RoutingReportCriteria.Builder.createByDocumentId(doc.getDocumentId());
criteria.setRuleTemplateNames(Collections.singletonList("WorkflowDocumentTemplate"));
DocumentDetail documentDetail = wdas.executeSimulation(criteria.build());
assertNotNull(documentDetail);
assertEquals("Document id returned should be the same as the one passed in", doc.getDocumentId(),
documentDetail.getDocument().getDocumentId());
assertEquals("Wrong number of action requests generated", 2, documentDetail.getActionRequests().size());
// let's try doing both WorkflowDocumentTemplate and WorkflowDocumentTemplate2 together
criteria.setRuleTemplateNames(Arrays.asList(new String[] { "WorkflowDocumentTemplate", "WorkflowDocument2Template" }));
documentDetail = wdas.executeSimulation(criteria.build());
assertEquals("Should have been 3 requests generated.", 3, documentDetail.getActionRequests().size());
boolean foundRkirkend = false;
boolean foundBmcgough = false;
boolean foundPmckown = false;
for (ActionRequest actionRequest : documentDetail.getActionRequests()) {
String netId = getPrincipalNameForId(actionRequest.getPrincipalId());
if (netId.equals("rkirkend")) {
foundRkirkend = true;
assertEquals(SeqSetup.WORKFLOW_DOCUMENT_NODE, actionRequest.getNodeName());
} else if (netId.equals("bmcgough")) {
foundBmcgough = true;
assertEquals(SeqSetup.WORKFLOW_DOCUMENT_NODE, actionRequest.getNodeName());
} else if (netId.equals("pmckown")) {
foundPmckown = true;
assertEquals(SeqSetup.WORKFLOW_DOCUMENT_2_NODE, actionRequest.getNodeName());
}
}
assertTrue("Did not find request for rkirkend", foundRkirkend);
assertTrue("Did not find request for bmcgough", foundBmcgough);
assertTrue("Did not find request for pmckown", foundPmckown);
}