use of com.tremolosecurity.provisioning.workflows.DynamicWorkflows in project OpenUnison by TremoloSecurity.
the class SendMessageThread method initWorkFlows.
/* (non-Javadoc)
* @see com.tremolosecurity.provisioning.core.ProvisioningEngine#initWorkFlows()
*/
@Override
public void initWorkFlows() throws ProvisioningException {
Iterator<String> wfNames = this.workflows.keySet().iterator();
while (wfNames.hasNext()) {
String name = wfNames.next();
this.workflows.get(name).init();
}
try {
if (cfgMgr.getCfg().getProvisioning() != null && cfgMgr.getCfg().getProvisioning().getWorkflows() != null && cfgMgr.getCfg().getProvisioning().getWorkflows().getDynamicWorkflows() != null && cfgMgr.getCfg().getProvisioning().getWorkflows().getDynamicWorkflows().isEnabled()) {
DynamicPortalUrlsType dynamicWorkflows = cfgMgr.getCfg().getProvisioning().getWorkflows().getDynamicWorkflows();
String className = dynamicWorkflows.getClassName();
HashMap<String, Attribute> cfgAttrs = new HashMap<String, Attribute>();
for (ParamType pt : dynamicWorkflows.getParams()) {
Attribute attr = cfgAttrs.get(pt.getName());
if (attr == null) {
attr = new Attribute(pt.getName());
cfgAttrs.put(pt.getName(), attr);
}
attr.getValues().add(pt.getValue());
}
DynamicWorkflows dynWorkflows = (DynamicWorkflows) Class.forName(className).newInstance();
dynWorkflows.loadDynamicWorkflows(cfgMgr, this, cfgAttrs);
}
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
throw new ProvisioningException("Could not initialize dynamic targets", e);
}
}
Aggregations