Questions Tagged With apihttps://answers.axonivy.com/tags/api/?type=rssquestions tagged <span class="tag">api</span>enSun, 21 Jun 2020 06:22:29 -0400REST http method PATCHhttps://answers.axonivy.com/questions/4613/rest-http-method-patch<p>Hi all We want to call a REST API with the method PATCH. But in the selector there is no such option. Is there a way to do it anyway? Thanks for the help. </p>renatostalderSun, 21 Jun 2020 06:22:29 -0400https://answers.axonivy.com/questions/4613/rest-http-method-patchapirestTrigger LDAP/AD role mapping by APIhttps://answers.axonivy.com/questions/4448/trigger-ldap-ad-role-mapping-by-api<p>Cheers,</p> <p>is there any way to trigger the synchronization with the LDAP / ActiveDirectory by calling an API endpoint? Or can I schedule the cron to run more than once daily?</p> <p>The background is that a customer might be modifying some role mappings on demand or shortly before starting a workflow.</p> <p>The version in question unfortunately is still 7.2.1, which contains a sync button in the RIA only. </p>mhoffmannTue, 10 Mar 2020 04:57:14 -0400https://answers.axonivy.com/questions/4448/trigger-ldap-ad-role-mapping-by-apiapiroleldapComplete Task from RESThttps://answers.axonivy.com/questions/4077/complete-task-from-rest<p>Hi Ivy Team,</p> <p>How to complete a task from REST service in Axon.Ivy ?</p> <p>So, far I saw that I can do .destroy() but it doesn`t feel the right, I believe that there will be some side effects </p> <p>or</p> <p>.setActivator(ivy.session.getSecurityContext().getSystemUser()) but this way I`m loosing the history who was the assignee of the task</p> <p>Any other options ?</p> <p>Maybe to do HTTP call to the end-point /TaskA.iot?taskId=7</p> <p>My goal is to build REST API that can manage the Axon.Ivy tasks from external system.</p> <p>Best Regards, Yordan</p>Stelt0Mon, 07 Oct 2019 09:40:24 -0400https://answers.axonivy.com/questions/4077/complete-task-from-restapijavaresttaskREST API and JSESSIONIDhttps://answers.axonivy.com/questions/4032/rest-api-and-jsessionid<p>Hi Ivy Team,</p> <p>Is there a way to get the JSESSIONID (or the whole cookie itself) of the logged in user ?</p> <p>I want to build a rest method which is authenticating the user. I need to return the cookie, so that next requests are authenticated</p> <p>BR, Yordan</p>Stelt0Mon, 30 Sep 2019 03:58:26 -0400https://answers.axonivy.com/questions/4032/rest-api-and-jsessionidauthenticationapijavarestJava Api for Start Process Signature variableshttps://answers.axonivy.com/questions/3984/java-api-for-start-process-signature-variables<p>Hello IvyTeam,</p> <p>Is there a way to get the list of parameters which are defined in the Signature of a process start element ? *I need this information before starting the process instance.</p> <p>I checked the public API but such information is not available. So, I assume there is an Internal API that I can use ? Can you provide some code snipet? </p> <p>Best Regards, Yordan</p>Stelt0Tue, 17 Sep 2019 09:38:57 -0400https://answers.axonivy.com/questions/3984/java-api-for-start-process-signature-variablesprocessapijavaGet data from database directly not via ElasticSearchhttps://answers.axonivy.com/questions/3935/get-data-from-database-directly-not-via-elasticsearch<p>Hi everyone, I have a case can not get data via ElasticSearch, I want to get data from iwa_bussiness in the database directly. Have any Ivy API to support this case?. Thank!</p>Phuoc NguyenWed, 28 Aug 2019 08:51:59 -0400https://answers.axonivy.com/questions/3935/get-data-from-database-directly-not-via-elasticsearchapielasticsearchdatabaseSet a task to DONE by using Ivy's APIhttps://answers.axonivy.com/questions/3618/set-a-task-to-done-by-using-ivy-s-api<p>Is it possible to set a suspended Task to DONE using the Ivy API? (as it is possible to destroy the task with ivy.task.destroy())</p> <p>UseCase: Within a process, a task is generated for a specific role (e.g. a task without user interaction / interface etc.) to report the progress. The system/process may now continue working in the background and, as soon it has been done its work, the state of the task should also be set to DONE by using java code (ivyscript code would also be possible). </p> <p>The reason for that is that the user should see this task in the task history but the task should not going to "destroyed"</p> <p>Thanks in advance for answers</p>StefanWed, 16 Jan 2019 05:44:48 -0500https://answers.axonivy.com/questions/3618/set-a-task-to-done-by-using-ivy-s-apiapitasksdoneStreaming with Ivy REST APIhttps://answers.axonivy.com/questions/3602/streaming-with-ivy-rest-api<p>Dear Ivy Team</p> <p>I have the following case: User should be able to upload scanned documents (1...xx MB) via Ivy and the data should be streamed through the REST service (layers). Since each REST service decouples (therefore no shared memory) the memory required to transport the document data could be quite high. To avoid that I would like to stream the data down to the persistency layer.</p> <p>Problem: Currently I am trying to pass binary data -&gt; "In Inscribe Rest Service Call Activity" -&gt; Body, entity -&gt; binary data and content-type=application/octet-stream and read it by the consumer REST service with HttpServletRequest request-&gt;getInputStream(). Though here I get an error (InputStream seems to be already closed).</p> <p>Question: Is this approach correct or do I have to use multipart/form-data (if yes, do you have an example, especially if the call is executed by the Ivy REST client).</p> <p>Thanks in advance for a feedback.</p> <p>Best Regards John</p>John MoserTue, 08 Jan 2019 10:00:55 -0500https://answers.axonivy.com/questions/3602/streaming-with-ivy-rest-apiapirestHow to secure Rest Services from Ivy 6.2 with Authorization Bearer instead of Basichttps://answers.axonivy.com/questions/3338/how-to-secure-rest-services-from-ivy-6-2-with-authorization-bearer-instead-of-basic<p>As the tittle. I'm using Ivy version 6.2 and would like to know how to secure my REST Services using Bearer Authorization instead of basic. Thanks</p>thminhThu, 21 Jun 2018 07:31:33 -0400https://answers.axonivy.com/questions/3338/how-to-secure-rest-services-from-ivy-6-2-with-authorization-bearer-instead-of-basicsecurityapirestIllegalStateException: Request scope has been already shut down WHEN I call APIshttps://answers.axonivy.com/questions/3274/illegalstateexception-request-scope-has-been-already-shut-down-when-i-call-apis<p>I have a simple API like that:</p> <pre><code>import javax.annotation.security.PermitAll; import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import ch.axonivy.epilot.web.application.services.FrontEndService; import ch.axonivy.epilot.web.application.services.FrontEndServiceImpl; @Singleton @Path("{applicationName}/v0/frontends") @PermitAll public class FrontEndApi { @GET @Produces(MediaType.APPLICATION_JSON) public Response getConfiguration(@QueryParam("token") String token) { FrontEndService frontEndService = new FrontEndServiceImpl(); FrontEndApiModel frontEndApiModel = frontEndService.getConfigurationByToken(token); return Response.status(Status.OK).entity(frontEndApiModel).build(); } } </code></pre> <p>And when I call it. The system throw exception:</p> <pre><code>javax.servlet.ServletException: java.lang.IllegalStateException: Request scope has been already shut down. at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilterInternal(IvyFilter.java:247) at ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilter(IvyFilter.java:152) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter$1.call(IvyExecuteAsSystemFilter.java:45) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter$1.call(IvyExecuteAsSystemFilter.java:1) at ch.ivyteam.ivy.security.internal.SecurityManager.executeAsSystem(SecurityManager.java:1313) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter.doFilter(IvyExecuteAsSystemFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.startup.IvyEngineUnavailableFilter.doFilter(IvyEngineUnavailableFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at ch.ivyteam.ivy.webserver.internal.PerformanceLogValve.invoke(PerformanceLogValve.java:55) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Request scope has been already shut down. at jersey.repackaged.com.google.common.base.Preconditions.checkState(Preconditions.java:173) at org.glassfish.jersey.process.internal.RequestScope.retrieveCurrent(RequestScope.java:239) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:314) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) ... 43 more </code></pre>Ron TranThu, 17 May 2018 04:54:51 -0400https://answers.axonivy.com/questions/3274/illegalstateexception-request-scope-has-been-already-shut-down-when-i-call-apisapiAccess to ivy environment outside a process request thread is not possible when call service from api controllerhttps://answers.axonivy.com/questions/3256/access-to-ivy-environment-outside-a-process-request-thread-is-not-possible-when-call-service-from-api-controller<p>My project has 2 parts.</p> <ul> <li>1st is web MVC with Primefaces.</li> <li>2nd is Rest API.</li> </ul> <p>When I call a service in the method, it work. Example:</p> <pre><code>@Singleton @RolesAllowed("OWNER") @Path("customers") public class CustomerController { @POST @Produces(MediaType.APPLICATION_JSON) public Response create(CustomerDetailModel customer) { CustomerService customerService = new CustomerServiceImpl(); try { String message = customerService.create(customer); return Response.status(Status.OK).entity(message).build(); } catch (NotFoundException nfe) { return Response.status(Status.NOT_FOUND).entity(nfe.getMessage()).build(); } } } </code></pre> <p>When I call the service outside method, it throw EnvironmentNotAvailableException. Example:</p> <pre><code>@Singleton @RolesAllowed("OWNER") @Path("customers") public class CustomerController { private CustomerService customerService = new CustomerServiceImpl(); @POST @Produces(MediaType.APPLICATION_JSON) public Response create(CustomerDetailModel customer) { try { String message = customerService.create(customer); return Response.status(Status.OK).entity(message).build(); } catch (NotFoundException nfe) { return Response.status(Status.NOT_FOUND).entity(nfe.getMessage()).build(); } } } </code></pre> <p>Exception:</p> <pre><code>javax.servlet.ServletException: A MultiException has 2 exceptions. They are: </code></pre> <ol> <li>ch.ivyteam.ivy.environment.EnvironmentNotAvailableException: Access to ivy environment outside a process request thread is not possible. Current thread: Thread[http-nio-8081-exec-2,5,main]</li> <li> <p>java.lang.IllegalStateException: Unable to perform operation: create on ch.axonivy.epilot.web.application.controllers.CustomerController</p> <p>at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilterInternal(IvyFilter.java:230) at ch.ivyteam.ivy.webserver.internal.IvyFilter.lambda$1(IvyFilter.java:160) at ch.ivyteam.util.callable.AbstractExecutionContext.lambda$0(AbstractExecutionContext.java:28) at ch.ivyteam.util.callable.AbstractExecutionContext.callInContext(AbstractExecutionContext.java:16) at ch.ivyteam.util.callable.AbstractExecutionContext.executeInContext(AbstractExecutionContext.java:26) at ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilterInRemoteClientContext(IvyFilter.java:160) at ch.ivyteam.ivy.webserver.internal.IvyFilter.lambda$0(IvyFilter.java:122) at ch.ivyteam.util.callable.AbstractExecutionContext.lambda$0(AbstractExecutionContext.java:28) at ch.ivyteam.util.callable.AbstractExecutionContext.callInContext(AbstractExecutionContext.java:16) at ch.ivyteam.util.callable.AbstractExecutionContext.executeInContext(AbstractExecutionContext.java:26) at ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilter(IvyFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter$1.call(IvyExecuteAsSystemFilter.java:45) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter$1.call(IvyExecuteAsSystemFilter.java:1) at ch.ivyteam.util.callable.AbstractExecutionContext.callInContext(AbstractExecutionContext.java:16) at ch.ivyteam.ivy.security.internal.SecurityManager.executeAsSystem(SecurityManager.java:1128) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter.doFilter(IvyExecuteAsSystemFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.startup.IvyEngineUnavailableFilter.doFilter(IvyEngineUnavailableFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at ch.ivyteam.ivy.webserver.internal.filter.IvyCurrentHttpRequestFilter.doFilter(IvyCurrentHttpRequestFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at ch.ivyteam.ivy.webserver.internal.PerformanceLogValve.invoke(PerformanceLogValve.java:55) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: A MultiException has 2 exceptions. They are: 1. ch.ivyteam.ivy.environment.EnvironmentNotAvailableException: Access to ivy environment outside a process request thread is not possible. Current thread: Thread[http-nio-8081-exec-2,5,main] 2. java.lang.IllegalStateException: Unable to perform operation: create on ch.axonivy.epilot.web.application.controllers.CustomerController</p> <p>at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:392) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487) at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:83) at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:71) at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154) at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199) at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:122) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2022) at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:774) at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:737) at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:707) at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:172) at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:284) at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:109) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:92) at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:318) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) ... 56 more Caused by: ch.ivyteam.ivy.environment.EnvironmentNotAvailableException: Access to ivy environment outside a process request thread is not possible. Current thread: Thread[http-nio-8081-exec-2,5,main] at ch.ivyteam.ivy.environment.Ivy.getIvy(Ivy.java:576) at ch.ivyteam.ivy.environment.Ivy.get(Ivy.java:479) at ch.axonivy.epilot.web.application.controllers.CustomerController.&lt;init&gt;(CustomerController.java:26) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1375) at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:272) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:366) ... 88 more</p> </li> </ol>Ron TranThu, 03 May 2018 22:36:12 -0400https://answers.axonivy.com/questions/3256/access-to-ivy-environment-outside-a-process-request-thread-is-not-possible-when-call-service-from-api-controllerapiivyREST token authenticationhttps://answers.axonivy.com/questions/2924/rest-token-authentication<p>We’ve been setting up a REST client but failed at configure the authentication. The API requires you to authenticate with a token. </p> <p>The documentation of the API tells you to pass the token through the «Authorization» header with its value being for example «Token: d2f763479f703d80de0ec15254237bc651f9cdc0». Doing this in the REST Client Activity element wasn’t successfully. </p> <p>So, what’s the correct way to pass the token to the API for authentication</p>Marco KlauenböschMon, 23 Oct 2017 10:08:48 -0400https://answers.axonivy.com/questions/2924/rest-token-authenticationauthenticationapirestDifferences of public apihttps://answers.axonivy.com/questions/2334/differences-of-public-api<p>Hi all</p> <p>There is many times that i saw similar public api from ivy then i could not distinguish between them, i believe some of my co-workers has the same feeling. In this post i need your help to make it more clear.</p> <p>Does they return the same result?</p> <p>1/ Application:</p> <pre><code>Ivy.request().getApplication() Ivy.wf().getApplication() Ivy.wfTask().getApplication() Ivy.wfCase().getApplication() Ivy.session().getWorkflowContext().getApplication() </code></pre> <p>2/ ProcessModel</p> <pre><code>Ivy.wfTask().getProcessModel() Ivy.wfCase().getProcessModel() </code></pre> <p>3/ ProcessModels</p> <pre><code>Ivy.wfCase().getApplication().getProcessModels() Ivy.wf().getApplication().getProcessModels() </code></pre> <p>4/ ProcessModelVersion</p> <pre><code>Ivy.request().getProcessModel().getProcessModelVersions() Ivy.request().getProcessModel().getReleasedProcessModelVersion() Ivy.request().getProject().getProcessModelVersion() Ivy.wfTask().getProcessModelVersion() Ivy.wfCase().getProcessModelVersion() Ivy.request().getProcessModelVersion() </code></pre> <p>There is some more but first i stop here :)</p> <p>Thanks in advance</p>trungdvThu, 29 Dec 2016 02:25:24 -0500https://answers.axonivy.com/questions/2334/differences-of-public-apiapiPermissions for ProcessModelVersionhttps://answers.axonivy.com/questions/2148/permissions-for-processmodelversion<p>Hi, we have by calling one Java Class from Ivy Script Step following permission checking:</p> <p>PermissionDeniedException: Session 2 (user1) is not allowed to call method public ch.ivyteam.ivy.application.ReleaseState ch.ivyteam.ivy.application.internal.ProcessModelVersion.getReleaseState().</p> <p>We can set "Disable permisison checking" by script step, but i would like to know how is it possible that checking happens.</p> <p>In which situations is this checked? We don't call this API method.</p>tauserThu, 27 Oct 2016 14:52:59 -0400https://answers.axonivy.com/questions/2148/permissions-for-processmodelversionapiHas method findWorkTasks() used for sending daily tasks changed in ivy 6.x?https://answers.axonivy.com/questions/1987/has-method-findworktasks-used-for-sending-daily-tasks-changed-in-ivy-6-x<p>We have upgraded an existing ivy 4.3.x project to ivy 6.0.4. After the update all users who receive the daily task email suddenly have some strange tasks in their email. After a short research I found that the following API method creates the list of tasks for the user:</p> <pre><code>ch.ivyteam.ivy.workflow.IWorkflowContext.findWorkTasks(IUser user, int startIndex, int count) </code></pre> <p>As we haven't actually changed anything at all I guess that this method now returns more tasks than in earlier versions. The additional tasks have an activator called "Top level role" and the expiryTimestamp is not set. </p> <p>Can anyone confirm this change in findWorkTasks or has an idea what the reason of this behaviour is?</p> <p>regards, marco </p>ruffzyWed, 24 Aug 2016 13:31:16 -0400https://answers.axonivy.com/questions/1987/has-method-findworktasks-used-for-sending-daily-tasks-changed-in-ivy-6-xapiemailtaskGet Project version programmaticallyhttps://answers.axonivy.com/questions/1982/get-project-version-programmatically<p>Hello All,</p> <p>Is there a way programmatically to get the project version from Deployment Descriptor ?</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Mon, 22 Aug 2016 16:10:49 -0400https://answers.axonivy.com/questions/1982/get-project-version-programmaticallysubversionapiHow update the INote in Ivyhttps://answers.axonivy.com/questions/1951/how-update-the-inote-in-ivy<p>Hello everyone,</p> <p>Recently, I have to manipulate for CRUD operation with INote in ivy. After I looked at the INoteable interface. I saw that Ivy team had just exposed some pubic api like createNote, deleteNote ..etc.</p> <p>My problem is that I want to update the INote with built-in feature in Ivy. How can I do that?</p> <p>@note: this is a link for INoteable api: <a href="http://developer.axonivy.com/doc/latest/publicApi/index.html?ch/ivyteam/ivy/workflow/INoteable.html">http://developer.axonivy.com/doc/latest/publicApi/index.html?ch/ivyteam/ivy/workflow/INoteable.html</a> Anybody help me, please</p> <p>Thanks alot</p>vhsvuongMon, 08 Aug 2016 16:36:55 -0400https://answers.axonivy.com/questions/1951/how-update-the-inote-in-ivyapiivyConfigure SystemTaskFailureBehaviour for system-wide or application-widehttps://answers.axonivy.com/questions/1715/configure-systemtaskfailurebehaviour-for-system-wide-or-application-wide<p>Hi Ivy team</p> <p>According to the public javadoc of <a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/workflow/SystemTaskFailureBehaviour.html">SystemTaskFailureBehaviour</a></p> <blockquote> <p>The following example shows how to set the behaviour:</p> </blockquote> <pre><code>ivy.response.setParameter("ch.ivyteam.ivy.workflow.SystemTaskFailureBehaviour", SystemTaskFailureBehaviour.FAIL_TASK_DO_NOT_RETRY); If the behaviour is not set in the system task process the default behaviour is SystemTaskFailureBehaviour.FAIL_TASK_DO_RETRY. </code></pre> <p>However, the snippet above only applies for a particular process by setting parameters of the <code>ivy.response</code>. </p> <p>Is there anyway that I can set <code>SystemTaskFailureBehaviour.FAIL_TASK_DO_NOT_RETRY</code> as default per application (or system)?</p> <p>Regards</p>Genzer HawkerMon, 04 Apr 2016 08:15:34 -0400https://answers.axonivy.com/questions/1715/configure-systemtaskfailurebehaviour-for-system-wide-or-application-widesystem-taskapitaskPersist first task using apihttps://answers.axonivy.com/questions/1644/persist-first-task-using-api<p>Hi all, at the Prozess start is possible to set in Workflow Mode "Persist task on creation". Is there any possibility to set this in script dynamically using API? We sometimes need it sometimes not.</p> <p>Karel Tauser</p>tauserThu, 28 Jan 2016 09:31:42 -0500https://answers.axonivy.com/questions/1644/persist-first-task-using-apiapiHow can i restrict password in login screen?https://answers.axonivy.com/questions/1243/how-can-i-restrict-password-in-login-screen<p>Hello , </p> <p>I currently use AxonIvy to create a workflow for users . I made a login screen with Name , Email and Password , but I need to set up the right conditions in order for the process not to go to the next step until the right password from the database is entered . Could you please help me with a script that I can correlate with the database password ?</p> <p>Thank you , Anda</p>andachiritaWed, 01 Apr 2015 10:41:38 -0400https://answers.axonivy.com/questions/1243/how-can-i-restrict-password-in-login-screenapiIs it possible to find the ICase that has lead to another ICase creation?https://answers.axonivy.com/questions/1220/is-it-possible-to-find-the-icase-that-has-lead-to-another-icase-creation<p>Hi everybody!</p> <p>I have a process which triggers another process start through a trigger step. The first process has a related ICase (ivy.case) and the 2d started process belongs to another ICase. We could consider in such a situation that the first ICase is the "ancestor" of the second one. Is there a possibility to get a reference to the "ancestor" ICase from the second one? Especially in a WorkflowEvent Listener like the one stated in this question: <a href="http://answers.axonivy.com/questions/1193/listen-to-process-case-start-and-task-creation-start">listen-to-process-case-start-and-task-creation-start</a></p> <p>A very convenient way would be something like:</p> <pre><code>IWorkflowEvent createEvent = wfManager.findWorkflowEvent(event.getId()); if (createEvent.getEventKind() != WorkflowEventKind.EVENT_CREATE_CASE) { return; } ICase newCase = createEvent.getCase(); newCase.getAncestorICase() // null if no ancestor, the ICase from which this newCase has been triggered </code></pre> <p>Thanks a lot in advance! Cheers Emmanuel</p>EmmanuelWed, 11 Mar 2015 02:54:29 -0400https://answers.axonivy.com/questions/1220/is-it-possible-to-find-the-icase-that-has-lead-to-another-icase-creationapiHow we can obtain the context of the business process programmatically?https://answers.axonivy.com/questions/1185/how-we-can-obtain-the-context-of-the-business-process-programmatically<p>We want to implement a feedback feature in which the user can submit a feedback at any where. What we want to achieve is to attach the context (what is the current screen, which point in the process, etc) into the feedback.</p> <p>I found out a way to (somehow) close to what we expect:</p> <pre><code>StringBuilder fullContextBuilder = new StringBuilder(); for (IIvyThreadLocal threadlocal : IvyThreadContext.getIvyThreadLocals()) { fullContextBuilder.append(threadlocal).append("\n"); } Ivy.log().error(fullContextBuilder.toString()); </code></pre> <p>However, the <code>IIvyThreadLocal</code> and <code>IvyThreadContext</code> are not <code>@PublicAPI</code> so we could not rely on them.</p> <p>Is there a public API which can help me to obtain the context of the business process (something like what printed in the log file for an exception)?</p> <p><strong>UPDATE</strong></p> <p>(It seems I was still ambiguous about what the process context mean)</p> <p>The process context here means what is the current dialog and the context when the feedback submittet. What is the route (dialogs to dialogs) that the user has accessed before submitting the feedback.</p> <p>The idea is something similar to what is printed in the Ivy Server log file. I started to digg into the <code>Logger</code> and <code>ExceptionUtil</code> which I experimented as the snippet above.</p> <p>Thanks &amp; Regards</p>Genzer HawkerMon, 02 Mar 2015 10:56:42 -0500https://answers.axonivy.com/questions/1185/how-we-can-obtain-the-context-of-the-business-process-programmaticallyprocessapicontextHow to call a logic process from another logic process within JSFhttps://answers.axonivy.com/questions/787/how-to-call-a-logic-process-from-another-logic-process-within-jsf<p>Hi there</p> <p>within ULC we often used the panel api to call some methods with the rdc logic. Means after pressing a button to save data the save event was triggered. In the logic of this save process we called a method on the panel (for example validate some data).</p> <p>Within JSF there is no longer a panel api available - but maybe you could give us a hint to solve this issue?</p> <p>Thanks for the fish, Sven</p>skilchenmannFri, 13 Jun 2014 10:03:21 -0400https://answers.axonivy.com/questions/787/how-to-call-a-logic-process-from-another-logic-process-within-jsfhtmluserdialogapijspHow to test if a user can start a process starthttps://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-start<p>I have an IUSER Object and IProcessStart, how can i test, if user is able to start this process start ?</p> <p>(i have no session of user, so i can't test it like ivy.session.getStartableProcessStarts() )</p>Karel TauserTue, 10 Jun 2014 14:37:37 -0400https://answers.axonivy.com/questions/768/how-to-test-if-a-user-can-start-a-process-startapiWhy I got warning about "Discourage access to CaseQuery/TaskQuery" when I use it in Java code?https://answers.axonivy.com/questions/740/why-i-got-warning-about-discourage-access-to-casequery-taskquery-when-i-use-it-in-java-code<p>Despite being one part of Ivy API but when I try to use CaseQuery/TaskQuery inside a Java class, the compiler yeilds warnings:</p> <blockquote> <p>Discouraged access: The type CaseQuery is not accessible due to restriction on required library C:\dev\ide\xpert.ivy.alag\4.3.20.44658\plugins\ch.ivyteam.ivy.workflow_4.3.20.44658.jar</p> </blockquote> <p>It's true that we can suppress those warnings by using <code>@SuppressWarnings("restriction")</code> but I want to know the reason why they are restricted? Is there anyway we can remove it?</p> <p>P.s: I use Ivy v4.3.20</p> <p>Thanks</p>Genzer HawkerThu, 05 Jun 2014 05:12:46 -0400https://answers.axonivy.com/questions/740/why-i-got-warning-about-discourage-access-to-casequery-taskquery-when-i-use-it-in-java-codeapiworkflowHow can i get all aplication of serverhttps://answers.axonivy.com/questions/738/how-can-i-get-all-aplication-of-server<p>Can somebody tell me, which API can I use, to get all Application on Server (as List&lt;iapplication&gt; or something like that). Thx</p>Karel TauserWed, 04 Jun 2014 12:19:09 -0400https://answers.axonivy.com/questions/738/how-can-i-get-all-aplication-of-serverapiHow to resend task notification e-mail?https://answers.axonivy.com/questions/709/how-to-resend-task-notification-e-mail<p>When a new task is created, Xpert.ivy sends a notification email to the asignee. This is of course based on some configuration stuff.</p> <p>I change the assignee of an existing task programatically (with public workflow API). Now I want the new assignee to get the task email. Is it possible to trigger this email again for some ITask?</p> <p>A workaround would setting the existing task to SYSTEM user and implement a loop in the business process to create a new task. This causes some side effects, that are not acceptable in my scenario.</p>Timo RuppTue, 20 May 2014 19:02:54 -0400https://answers.axonivy.com/questions/709/how-to-resend-task-notification-e-mailivyscriptapiHow can I create a role at runtime dynamically?https://answers.axonivy.com/questions/264/how-can-i-create-a-role-at-runtime-dynamically<p>Is there any public APIs to make an IRole at runtime by programming? </p> <p>Because in our project, we need a process to handle add/remove IRole automatically (no need to login to Ivy Server and create it by manually)</p> <p>Thank you so much.</p>nghianguyenMon, 20 Jan 2014 07:47:27 -0500https://answers.axonivy.com/questions/264/how-can-i-create-a-role-at-runtime-dynamicallyapiroleChange application environment on loginhttps://answers.axonivy.com/questions/235/change-application-environment-on-login<p>Hi there</p> <p>is it possible to change the used environment for an user by api? Means we implement some logic in the login process which detects the postfix of a user. If it matches _test we should use the test environment if not we use the default which is set in application configuration.</p> <p>Thanks for the fish, Sven</p>skilchenmannWed, 08 Jan 2014 09:50:20 -0500https://answers.axonivy.com/questions/235/change-application-environment-on-loginenvironmentapiChange user language at runtimehttps://answers.axonivy.com/questions/41/change-user-language-at-runtime<p>How can I set the user language at runtime?</p>jschoriTue, 29 Oct 2013 16:53:16 -0400https://answers.axonivy.com/questions/41/change-user-language-at-runtimeapi