public WorkItemOperationKindType getOperationKind() { return operationInfo != null ? operationInfo.getOperationKind() : null; }
public WorkItemEventCauseInformationType getCause() { return sourceInfo != null ? sourceInfo.getCause() : null; }
public AbstractWorkItemActionType getSource() { return sourceInfo != null ? sourceInfo.getSource() : null; }
private void executeNotifications(Duration timeBeforeAction, AbstractWorkItemActionType action, WorkItemType workItem, Task wfTask, OperationResult result) throws SchemaException { WorkItemOperationKindType operationKind = WfContextUtil.getOperationKind(action); WorkItemEventCauseInformationType cause = WfContextUtil.createCause(action); List<ObjectReferenceType> assigneesAndDeputies = wfTaskController.getAssigneesAndDeputies(workItem, wfTask, result); WorkItemAllocationChangeOperationInfo operationInfo = new WorkItemAllocationChangeOperationInfo(operationKind, assigneesAndDeputies, null); WorkItemOperationSourceInfo sourceInfo = new WorkItemOperationSourceInfo(null, cause, action); wfTaskController.notifyWorkItemAllocationChangeCurrentActors(workItem, operationInfo, sourceInfo, timeBeforeAction, wfTask, result); }
@Override public void completeWorkItem(String workItemId, boolean decision, String comment, ObjectDelta additionalDelta, OperationResult parentResult) throws SecurityViolationException, SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException { getWorkflowManagerChecked().completeWorkItem(workItemId, decision, comment, additionalDelta, null, parentResult); }
@PostConstruct public void init() { if (workflowManager != null) { workflowManager.registerProcessListener(this); workflowManager.registerWorkItemListener(this); } else { LOGGER.warn("WorkflowManager not present, notifications for workflows will not be enabled."); } }
public void notifyWorkItemAllocationChangeCurrentActors(WorkItemType workItem, @NotNull WorkItemAllocationChangeOperationInfo operationInfo, WorkItemOperationSourceInfo sourceInfo, Duration timeBefore, Task wfTask, OperationResult result) throws SchemaException { for (WorkItemListener workItemListener : workItemListeners) { workItemListener.onWorkItemAllocationChangeCurrentActors(workItem, operationInfo, sourceInfo, timeBefore, wfTask, result); } }
public void notifyWorkItemAllocationChangeNewActors(WorkItemType workItem, @NotNull WorkItemAllocationChangeOperationInfo operationInfo, @Nullable WorkItemOperationSourceInfo sourceInfo, Task wfTask, OperationResult result) throws SchemaException { for (WorkItemListener workItemListener : workItemListeners) { workItemListener.onWorkItemAllocationChangeNewActors(workItem, operationInfo, sourceInfo, wfTask, result); } }
public void notifyWorkItemCustom(@Nullable ObjectReferenceType assignee, WorkItemType workItem, WorkItemEventCauseInformationType cause, Task wfTask, @NotNull WorkItemNotificationActionType notificationAction, OperationResult result) throws SchemaException { for (WorkItemListener workItemListener : workItemListeners) { workItemListener.onWorkItemCustomEvent(assignee, workItem, notificationAction, cause, wfTask, result); } }
@Override public void delegateWorkItem(String workItemId, List<ObjectReferenceType> delegates, WorkItemDelegationMethodType method, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException { getWorkflowManagerChecked().delegateWorkItem(workItemId, delegates, method, parentResult); }
private void notifyProcessEnd(WfTask wfTask, OperationResult result) throws SchemaException { for (ProcessListener processListener : processListeners) { processListener.onProcessInstanceEnd(wfTask.getTask(), result); } }
private void notifyProcessStart(WfTask wfTask, OperationResult result) throws SchemaException { for (ProcessListener processListener : processListeners) { processListener.onProcessInstanceStart(wfTask.getTask(), result); } }
private void notifyWorkItemCreated(ObjectReferenceType originalAssigneeRef, WorkItemType workItem, WfTask wfTask, OperationResult result) throws SchemaException { for (WorkItemListener workItemListener : workItemListeners) { workItemListener.onWorkItemCreation(originalAssigneeRef, workItem, wfTask.getTask(), result); } }
private void notifyWorkItemDeleted(ObjectReferenceType assignee, WorkItemType workItem, WorkItemOperationInfo operationInfo, WorkItemOperationSourceInfo sourceInfo, WfTask wfTask, OperationResult result) throws SchemaException { for (WorkItemListener workItemListener : workItemListeners) { workItemListener.onWorkItemDeletion(assignee, workItem, operationInfo, sourceInfo, wfTask.getTask(), result); } }
@Override public void releaseWorkItem(String workItemId, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException { getWorkflowManagerChecked().releaseWorkItem(workItemId, parentResult); }
private SimpleObjectRef getInitiator(WorkItemOperationSourceInfo sourceInfo) { return sourceInfo != null ? SimpleObjectRefImpl.create(functions, sourceInfo.getInitiatorRef()) : null; }
@Override public void claimWorkItem(String workItemId, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException { getWorkflowManagerChecked().claimWorkItem(workItemId, parentResult); }
@Override public void synchronizeWorkflowRequests(Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException { securityEnforcer.authorize(ModelAuthorizationAction.SYNCHRONIZE_WORKFLOW_REQUESTS.getUrl(), null, AuthorizationParameters.EMPTY, null, operationTask, parentResult); workflowManager.synchronizeWorkflowRequests(parentResult); }
@Override public void cleanupActivitiProcesses(Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException { securityEnforcer.authorize(ModelAuthorizationAction.CLEANUP_PROCESS_INSTANCES.getUrl(), null, AuthorizationParameters.EMPTY, null, task, parentResult); getWorkflowManagerChecked().cleanupActivitiProcesses(parentResult); }
public void approveAllWorkItems(Task task, OperationResult result) throws Exception { List<WorkItemType> workItems = getWorkItems(task, result); display("work items", workItems); display("approving work items"); for (WorkItemType workItem : workItems) { workflowManager.completeWorkItem(workItem.getExternalId(), true, null, null, null, result); } }