use of org.apache.syncope.core.provisioning.api.WorkflowResult in project syncope by apache.
the class FlowableUserWorkflowAdapter method doActivate.
@Override
protected WorkflowResult<String> doActivate(final User user, final String token) {
Set<String> tasks = doExecuteTask(user, "activate", Collections.singletonMap(TOKEN, (Object) token));
updateStatus(user);
User updated = userDAO.save(user);
return new WorkflowResult<>(updated.getKey(), null, tasks);
}
use of org.apache.syncope.core.provisioning.api.WorkflowResult in project syncope by apache.
the class FlowableUserWorkflowAdapter method requestCertify.
@Override
public WorkflowResult<String> requestCertify(final User user) {
String authUser = AuthContextUtils.getUsername();
engine.getRuntimeService().setVariable(user.getWorkflowId(), FORM_SUBMITTER, authUser);
LOG.debug("Executing request-certify");
Set<String> performedTasks = doExecuteTask(user, "request-certify", null);
PropagationByResource propByRes = engine.getRuntimeService().getVariable(user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
saveForFormSubmit(user, null, propByRes);
return new WorkflowResult<>(user.getKey(), null, performedTasks);
}
use of org.apache.syncope.core.provisioning.api.WorkflowResult in project syncope by apache.
the class FlowableUserWorkflowAdapter method doUpdate.
@Override
protected WorkflowResult<Pair<UserPatch, Boolean>> doUpdate(final User user, final UserPatch userPatch) {
Set<String> tasks = doExecuteTask(user, "update", Collections.singletonMap(USER_PATCH, (Object) userPatch));
updateStatus(user);
User updated = userDAO.save(user);
PropagationByResource propByRes = engine.getRuntimeService().getVariable(user.getWorkflowId(), PROP_BY_RESOURCE, PropagationByResource.class);
UserPatch updatedPatch = engine.getRuntimeService().getVariable(user.getWorkflowId(), USER_PATCH, UserPatch.class);
saveForFormSubmit(updated, updatedPatch.getPassword() == null ? null : updatedPatch.getPassword().getValue(), propByRes);
Boolean propagateEnable = engine.getRuntimeService().getVariable(user.getWorkflowId(), PROPAGATE_ENABLE, Boolean.class);
return new WorkflowResult<>(Pair.of(updatedPatch, propagateEnable), propByRes, tasks);
}
use of org.apache.syncope.core.provisioning.api.WorkflowResult in project syncope by apache.
the class DefaultAnyObjectWorkflowAdapter method doCreate.
@Override
protected WorkflowResult<String> doCreate(final AnyObjectTO anyObjectTO) {
AnyObject anyObject = entityFactory.newEntity(AnyObject.class);
dataBinder.create(anyObject, anyObjectTO);
anyObject = anyObjectDAO.save(anyObject);
PropagationByResource propByRes = new PropagationByResource();
propByRes.set(ResourceOperation.CREATE, anyObjectDAO.findAllResourceKeys(anyObject.getKey()));
return new WorkflowResult<>(anyObject.getKey(), propByRes, "create");
}
use of org.apache.syncope.core.provisioning.api.WorkflowResult in project syncope by apache.
the class DefaultUserWorkflowAdapter method doSuspend.
@Override
protected WorkflowResult<String> doSuspend(final User user) {
user.setStatus("suspended");
User updated = userDAO.save(user);
return new WorkflowResult<>(updated.getKey(), null, "suspend");
}
Aggregations