<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Can not create task inside overriding sub process because of IllegalStateException on TaskSwitch</title><link>https://answers.axonivy.com/questions/1894/can-not-create-task-inside-overriding-sub-process-because-of-illegalstateexception-on-taskswitch</link><description>&lt;p&gt;Hi ivy team&lt;/p&gt;
&lt;p&gt;In my current project, we have structure like this picture:
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/1111_pdSi6Ce.jpg"&gt;&lt;/p&gt;
&lt;p&gt;I can explain structure in some more words:
 - We have three module: Standard, Wir and Wir Test. Wir  depend on Standard and Wir Test  depend on Wir&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In Standard we have one CallableSub &lt;em&gt;Document Entry Process&lt;/em&gt; and it call another callablesub &lt;em&gt;Handler Document Entry&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In wir, we override the &lt;em&gt;Handler Document Entry&lt;/em&gt; to create Ivy Task (use Task Switch/UserTask) then open the HtmlUserDialog of Wir project. We use the overriding function from Ivy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we have the start link from Wir Test (actually no matter where we put the startlink, could be on Wir),and it call &lt;em&gt;Document Entry Process&lt;/em&gt; from standard, then run the Overriding Process of &lt;em&gt;Handler Document Entry&lt;/em&gt; on Wir. &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But when the process hit to Task Element, it throw this exception:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    ch.ivyteam.ivy.request.RequestException: ivy:error:system
    at ch.ivyteam.ivy.request.RequestException$RequestExceptionBuilder.build(RequestException.java:161)
    at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleNormalRequest(BpmEngine.java:195)
    at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleRequestWithinContext(BpmEngine.java:140)
    at ch.ivyteam.ivy.request.impl.ContextAwareRequestHandler.handleRequest(ContextAwareRequestHandler.java:32)
    at ch.ivyteam.ivy.system.task.internal.SystemTaskJob.executeProcess(SystemTaskJob.java:127)
    at ch.ivyteam.ivy.system.task.internal.SystemTaskJob.executeAsSystem(SystemTaskJob.java:92)
    at ch.ivyteam.ivy.system.task.internal.SystemTaskJob$1.call(SystemTaskJob.java:56)
    at ch.ivyteam.ivy.security.internal.SecurityManager.executeAsSystem(SecurityManager.java:1467)
    at ch.ivyteam.ivy.system.task.internal.SystemTaskJob.execute(SystemTaskJob.java:52)
    at ch.ivyteam.ivy.job.internal.JobManager$1.call(JobManager.java:267)
    at ch.ivyteam.ivy.job.internal.JobManager$1.call(JobManager.java:1)
    at ch.ivyteam.util.callable.ExecutionContextContainer$ContainerExecutionContext.call(ExecutionContextContainer.java:92)
    at ch.ivyteam.ivy.security.internal.SecurityManager.executeInContext_aroundBody0(SecurityManager.java:1519)
    at ch.ivyteam.ivy.security.internal.SecurityManager.executeInContext_aroundBody1$advice(SecurityManager.java:41)
    at ch.ivyteam.ivy.security.internal.SecurityManager.executeInContext(SecurityManager.java:1)
    at ch.ivyteam.util.callable.ExecutionContextContainer$ContainerExecutionContext.call(ExecutionContextContainer.java:88)
    at ch.ivyteam.util.callable.ExecutionContextContainer.executeInContext(ExecutionContextContainer.java:27)
    at ch.ivyteam.ivy.job.internal.JobManager.execute(JobManager.java:261)
    at ch.ivyteam.ivy.job.internal.Job.run(Job.java:83)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745) Caused by: BpmError ivy:error:system
Unique ID: 155EDB7F283297EF
     Process Element: create task for Document entry &amp;lt;155C371802ADDD14-f62&amp;gt;
     Process Call Stack:
      DocumentEntryProcess &amp;lt;154380E2AD199B4E-f1&amp;gt;
      BaseDocumentProcess &amp;lt;1559F2D43EBE9F5C-f3&amp;gt;
        at ch.ivyteam.ivy.bpm.error.BpmErrorBuilder.build(BpmErrorBuilder.java:204)
        at ch.ivyteam.ivy.bpm.engine.restricted.error.BpmErrorHandler.getBpmErrorFor(BpmErrorHandler.java:90)
        at ch.ivyteam.ivy.bpm.engine.restricted.error.BpmErrorHandler.handleException(BpmErrorHandler.java:45)
        at ch.ivyteam.ivy.bpm.engine.internal.core.ProcessElementExecution.execute(ProcessElementExecution.java:42)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleExecution(RequestProcessor.java:140)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.processRequest(RequestProcessor.java:130)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleRequest(RequestProcessor.java:95)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleCallRequest(RequestProcessor.java:86)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleCallRequest(BpmEngine.java:243)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleCallRequest(BpmEngine.java:227)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleRequestWithinContext(BpmEngine.java:132)
        at ch.ivyteam.ivy.request.impl.ContextAwareRequestHandler.handleRequest(ContextAwareRequestHandler.java:32)
        at ch.ivyteam.ivy.bpm.engine.internal.CallService.handleRequest(CallService.java:101)
        at ch.ivyteam.ivy.bpm.engine.internal.CallService.callTarget(CallService.java:93)
        at ch.ivyteam.ivy.bpm.engine.internal.CallService.call(CallService.java:59)
        at ch.ivyteam.ivy.bpm.engine.internal.core.ProcessCallExecution.execute(ProcessCallExecution.java:25)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleExecution(RequestProcessor.java:140)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.processRequest(RequestProcessor.java:130)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleRequest(RequestProcessor.java:95)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleCallRequest(RequestProcessor.java:86)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleCallRequest(BpmEngine.java:243)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleCallRequest(BpmEngine.java:227)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleRequestWithinContext(BpmEngine.java:132)
        at ch.ivyteam.ivy.request.impl.ContextAwareRequestHandler.handleRequest(ContextAwareRequestHandler.java:32)
        at ch.ivyteam.ivy.bpm.engine.internal.CallService.handleRequest(CallService.java:101)
        at ch.ivyteam.ivy.bpm.engine.internal.CallService.callTarget(CallService.java:93)
        at ch.ivyteam.ivy.bpm.engine.internal.CallService.call(CallService.java:59)
        at ch.ivyteam.ivy.bpm.engine.internal.core.ProcessCallExecution.execute(ProcessCallExecution.java:25)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleExecution(RequestProcessor.java:140)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.processRequest(RequestProcessor.java:130)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleRequest(RequestProcessor.java:95)
        at ch.ivyteam.ivy.bpm.engine.internal.core.RequestProcessor.handleRequest(RequestProcessor.java:77)
        at ch.ivyteam.ivy.bpm.engine.internal.BpmEngine.handleNormalRequest(BpmEngine.java:191)
        ... 22 more
    Caused by: java.lang.IllegalStateException: TaskSwitch element (TaskSwitchElement [id=155C371802ADDD14-f62, name=create task for Document entry, type=UserTask]) is not permitted inside a sub process of a required project.
        at ch.ivyteam.ivy.bpm.engine.internal.model.bpmn.TaskSwitchElementExecutorAdapter.checkIllegalTaskSwitchUsage(TaskSwitchElementExecutorAdapter.java:111)
        at ch.ivyteam.ivy.bpm.engine.internal.model.bpmn.TaskSwitchElementExecutorAdapter.execute(TaskSwitchElementExecutorAdapter.java:81)
        at ch.ivyteam.ivy.bpm.engine.internal.model.ProcessElement.lambda$0(ProcessElement.java:215)
        at ch.ivyteam.ivy.bpm.engine.internal.model.ProcessElement.executeInElementContext(ProcessElement.java:286)
        at ch.ivyteam.ivy.bpm.engine.internal.model.ProcessElement.execute(ProcessElement.java:215)
        at ch.ivyteam.ivy.bpm.engine.internal.core.ProcessElementExecution.execute(ProcessElementExecution.java:37)
        ... 51 more
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Does anyone know about this issue? Why it happen and how to solve it&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1894/can-not-create-task-inside-overriding-sub-process-because-of-illegalstateexception-on-taskswitch" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 15 Jul 2016 15:25:41 -0400</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1894/can-not-create-task-inside-overriding-sub-process-because-of-illegalstateexception-on-taskswitch/1897</link><description>&lt;p&gt;In a process you are only allowed to create tasks in the Project in which the process was started. It is not allowed to create tasks in required projects or in overriding projects. This is as restriction by design.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Fri, 15 Jul 2016 15:25:41 -0400</pubDate><guid>https://answers.axonivy.com/questions/1894/can-not-create-task-inside-overriding-sub-process-because-of-illegalstateexception-on-taskswitch/1897</guid></item></channel></rss>