aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorGerwin Gsenger <g.gsenger@datentechnik-innovation.at>2015-01-28 11:52:10 +0100
committerGerwin Gsenger <g.gsenger@datentechnik-innovation.at>2015-01-28 11:52:10 +0100
commit7ae32988fcf9e4407b4bcae7831772338da55a8f (patch)
tree66c2227dd30515fe6a8fe163d1e0e8687430074a /id
parentaa216fc322265515a67e5218e33700e95b7788d3 (diff)
downloadmoa-id-spss-7ae32988fcf9e4407b4bcae7831772338da55a8f.tar.gz
moa-id-spss-7ae32988fcf9e4407b4bcae7831772338da55a8f.tar.bz2
moa-id-spss-7ae32988fcf9e4407b4bcae7831772338da55a8f.zip
switch to automated process selection
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java29
1 files changed, 20 insertions, 9 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java
index 430936e97..6e817e2a5 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java
@@ -41,12 +41,15 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType;
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
+import at.gv.egovernment.moa.id.moduls.moduleregistration.ModuleRegistration;
import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.FileUtils;
import at.gv.egovernment.moa.util.MiscUtil;
+import com.datentechnik.process_engine.ExecutionContextImpl;
import com.datentechnik.process_engine.ProcessInstance;
+import com.datentechnik.process_engine.api.ExecutionContext;
public class GenerateIFrameTemplateServlet extends AuthServlet {
@@ -144,16 +147,24 @@ public class GenerateIFrameTemplateServlet extends AuthServlet {
moasession.getAction(),
req);
}
-
+
+ ExecutionContext ec = new ExecutionContextImpl();
+ // set execution context
+ ec.put("ccc", moasession.getCcc());
+ ec.put("useMandate", moasession.getUseMandate());
+ ec.put("bkuURL", moasession.getBkuURL());
+
// select and create process instance
- // TODO[MOAID-49]: Automatically selection of process
- ProcessInstance pi = getProcessEngine().createProcessInstance("DefaultAuthentication");
- // keep process instance id in moa session
- moasession.setProcessInstanceId(pi.getId());
- // set execution context
- pi.getExecutionContext().put("ccc", moasession.getCcc());
- pi.getExecutionContext().put("useMandate", moasession.getUseMandate());
- pi.getExecutionContext().put("bkuURL", moasession.getBkuURL());
+ String processDefinitionId = ModuleRegistration.getInstance().selectProcess(ec);
+ ProcessInstance pi = getProcessEngine().createProcessInstance(processDefinitionId, ec);
+
+ if (processDefinitionId == null) {
+ Logger.warn("No suitable process found for SessionID " + moasession.getSessionID());
+ throw new MOAIDException("process.02", new Object[] { moasession.getSessionID() });
+ }
+
+ // keep process instance id in moa session
+ moasession.setProcessInstanceId(pi.getId());
// make sure moa session has been persisted before running the process
try {