com.netgrif.application.engine.auth.web.responsebodies.ProcessRoleFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.auth.web.responsebodies;
import com.netgrif.application.engine.petrinet.domain.PetriNet;
import com.netgrif.application.engine.petrinet.service.interfaces.IPetriNetService;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Locale;
@Service
public class ProcessRoleFactory implements IProcessRoleFactory {
@Autowired
private IPetriNetService petriNetService;
@Override
public ProcessRole getProcessRole(com.netgrif.application.engine.petrinet.domain.roles.ProcessRole role, Locale locale) {
/*if (!role.getStringId().equals(userProcessRole.getRoleId())) {
throw new IllegalArgumentException(String.format("ProcessRole StringId (%s) and UserProcessRole roleId (%s) must match!", role.getStringId(), userProcessRole.getRoleId()));
}*/
ProcessRole result = new ProcessRole(role, locale);
PetriNet net = petriNetService.get(new ObjectId(role.getNetId()));
result.setNetStringId(net.getStringId());
result.setNetImportId(net.getImportId());
result.setNetVersion(net.getVersion().toString());
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy