本文整理汇总了Java中org.kuali.rice.kew.api.WorkflowDocument.getValidActions方法的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocument.getValidActions方法的具体用法?Java WorkflowDocument.getValidActions怎么用?Java WorkflowDocument.getValidActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.api.WorkflowDocument
的用法示例。
在下文中一共展示了WorkflowDocument.getValidActions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkActions
import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
private WorkflowDocument checkActions(String networkId,String documentId,String[] validActionsAllowed,String[] invalidActionsNotAllowed) throws Exception {
WorkflowDocument document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName(networkId), documentId);
org.kuali.rice.kew.api.action.ValidActions validActions = document.getValidActions();
Set<ActionType> validActionsSet = validActions.getValidActions();
for (int i = 0; i < validActionsAllowed.length; i++) {
String actionAllowed = validActionsAllowed[i];
if (!validActionsSet.contains(ActionType.fromCode(actionAllowed))) {
fail("Action '" + KewApiConstants.ACTION_TAKEN_CD.get(actionAllowed) + "' should be allowed for user " + networkId);
}
}
for (int j = 0; j < invalidActionsNotAllowed.length; j++) {
String actionDisallowed = invalidActionsNotAllowed[j];
if (validActionsSet.contains(ActionType.fromCode(actionDisallowed))) {
fail("Action '" + KewApiConstants.ACTION_TAKEN_CD.get(actionDisallowed) + "' should not be allowed for user " + networkId);
}
}
return document;
}