Questions Tagged With ivyscripthttps://answers.axonivy.com/tags/ivyscript/?type=rssquestions tagged <span class="tag">ivyscript</span>enFri, 11 Oct 2019 04:58:01 -0400Syntax Highligting for Ivyscripthttps://answers.axonivy.com/questions/4097/syntax-highligting-for-ivyscript<p>Hello, Is there any way to do syntax highlighting in ivyScript? </p>TareqKFri, 11 Oct 2019 04:58:01 -0400https://answers.axonivy.com/questions/4097/syntax-highligting-for-ivyscriptivyscriptdesignerrequestElasticsearch fail because auto-conversion changes String values into Datehttps://answers.axonivy.com/questions/3903/elasticsearch-fail-because-auto-conversion-changes-string-values-into-date<p>We get an error of the Elasticsearch by saving a BusinessObject over the ivy.repo with a field of type <code>Map&lt; String,String &gt;</code>.</p> <pre><code>Elasticsearch update index of document failed because of: {"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [details.data.Value1] of different type, current_type [text], merged_type [date]"}],"type":"illegal_argument_exception","reason":"mapper [details.data.Value1] of different type, current_type [text], merged_type [date]"}</code></pre> <p>The problem ist clear. The field "details.data.Value1" is a date field and i try to store a String.</p> <p><strong>But</strong> the definition of our BusinessObject is different to that!<br> The field "data" of the "detail" object is defined as a <code>Map&lt; String,String &gt;</code>.<br> We get this error when we run the following code in an IvyScript (we used a helper class for Maps, because IvyScript is not able to handle double generics).</p> <pre><code>JobDetail detail = new JobDetail(); Helper helper = new Helper(); helper.setParam("Value1", (new Date()).toString()); detail.data = helper.getParams(); job.details.add(detail); detail = new JobDetail(); helper.setParam("Value1", "foo"); detail.data = helper.getParams(); job.details.add(detail);</code></pre> <p>Why does Elasticsearch change the given attribute to a date field, although we just fill in String values?<br> Furthermore we defined the value as a Map of Sting-String value pairs.<br> Is there a solution of this issue?</p> <p>We decided not to use JSON objects instead of our Map, because of the easy handling in further uses.</p>Adrian ImfeldWed, 31 Jul 2019 04:33:14 -0400https://answers.axonivy.com/questions/3903/elasticsearch-fail-because-auto-conversion-changes-string-values-into-datebusiness-dataelasticsearchivyscriptHow can I set a Task with dynamic name by Ivy scripthttps://answers.axonivy.com/questions/3359/how-can-i-set-a-task-with-dynamic-name-by-ivy-script<p>Hi there. Today, I have a problem with the name of a task. The first time, when I create a task with a name <strong>ABC</strong>, after do something, it changes <strong>XYZ</strong>. I changed the task name by Ivy script, like this:</p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/dasdasdas.png"></p> <p>My problem is now, the task name can't be changed reply on the locale. My question is <strong><em>How can I use cms to set for a dynamic name for Task and then let it resolves by CMS?</em></strong></p> <p>Thanks so much.</p>TuyenFri, 20 Jul 2018 06:33:52 -0400https://answers.axonivy.com/questions/3359/how-can-i-set-a-task-with-dynamic-name-by-ivy-scriptivyscripttaskcmsHow to properly integrate and deploy a third-party library in an ivy project and deploy it to the engine?https://answers.axonivy.com/questions/2953/how-to-properly-integrate-and-deploy-a-third-party-library-in-an-ivy-project-and-deploy-it-to-the-engine<p>Hi,</p> <p>we've modeled a process where some IvyScript tasks make use of a third-party library. For usage in the ivy Designer we just added it to our ivy project and it worked. But whenever we try to deploy everything to the engine we get an error which says that a class from the mentioned library is not available. </p> <p>Hence, my question is: What is the standard workflow to integrate and deploy third-party libraries properly? Do we have to add them manually to some special engine folder (I'm just wondering because I've found some lib folders)?</p> <p>Thank you very much in advance and kind regards, Lars</p>LaAckFri, 03 Nov 2017 08:56:59 -0400https://answers.axonivy.com/questions/2953/how-to-properly-integrate-and-deploy-a-third-party-library-in-an-ivy-project-and-deploy-it-to-the-engineivyscriptjarbuildlibrarydeploymentWhat is the right way to check the OS where ivy is running?https://answers.axonivy.com/questions/2662/what-is-the-right-way-to-check-the-os-where-ivy-is-running<p>Hello Ivy Team,</p> <p>I`m wandering what is the best practice(if any) to check what is the operating system where Ivy is currently running (i.e. Windows 10, Windows Server 2012, Linux, MacOS, etc..)</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Fri, 02 Jun 2017 03:11:20 -0400https://answers.axonivy.com/questions/2662/what-is-the-right-way-to-check-the-os-where-ivy-is-runningengineenvironmentivyscriptdesignerI can't import java.util.Date in script step, why?https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-why<p><img alt="Import java.uti.date in script step" src="http://answers.axonivy.com/upfiles/import-java-util-date.png"></p> <p>I can't import java.util.Date, why?</p>Alex SuterMon, 13 Mar 2017 08:13:25 -0400https://answers.axonivy.com/questions/2489/i-can-t-import-java-util-date-in-script-step-whyivyscriptHow to debug Ivy Script?https://answers.axonivy.com/questions/2183/how-to-debug-ivy-script<p>Hi, I'm currently extending a existing Ivy application. I face the problem of being unable to debug (trace) Ivy script.</p> <p>Is there some tooling? maybe some trick to output directly into the "runtime log" of the designer?</p> <p>I've already hack the logger to display SQL and such. I'm familiar with web development, java, tomcat and most of the ecosystem. I just have hard time tracing the logic in process. I currently have a bug with Ivy add on, I replace all parameter values one by one with hardcoded values to see what is going on. I've figure out which variable is erroneous but can't figure out what's in it.</p>RemiMorinMon, 14 Nov 2016 20:41:45 -0500https://answers.axonivy.com/questions/2183/how-to-debug-ivy-scriptdebuggingivyscriptdesignerIvyScript - support for Streams and Lambda expressionshttps://answers.axonivy.com/questions/1902/ivyscript-support-for-streams-and-lambda-expressions<p>Hi All,</p> <p>I see that IvyScript does not support some of the new features in Java8 like Streams and Lambda expressions. Is it in the road-map ?</p> <p><img alt="alt text" src="http://answers.axonivy.com/upfiles/img.jpg"></p> <p>Best Regards, Yordan Yunchov</p>Stelt0Mon, 18 Jul 2016 13:22:42 -0400https://answers.axonivy.com/questions/1902/ivyscript-support-for-streams-and-lambda-expressionsivyscriptjavaInconveniences when using inner classes in Ivy Scripthttps://answers.axonivy.com/questions/1756/inconveniences-when-using-inner-classes-in-ivy-script<p>Suppose I have two classes, each of them provides <code>Builder</code> API.</p> <pre><code>// This is in Ivy Script import example.Person.Builder; Builder errorPersonBuilder = new Person.Builder(); // this line generates a compilation error saying class Person.Builder not found. Builder workingPersonBuilder = new Builder(); // this works. </code></pre> <p>It is still OK if there is only one <code>Builder</code> inside the context. As soon as there is another:</p> <pre><code>// This is in Ivy Script import example.Person.Builder; import example.Company.Builder; // compilation error of collision, there are two classes named Builder. Builder workingPersonBuilder = new Builder(); // this works, see above. Builder anotherBuilder = new Builder(); // which builder? </code></pre> <p>If Ivy Script could supports the same as normal Java, we could do:</p> <pre><code>import example.Person.Builder; import example.Company.Builder; Person.Builder personBuilder = new Person.Builder(); Company.Builder companyBuilder = new Company.Builder(); </code></pre> <p>Should this be supported in Ivy Script?</p>Genzer HawkerFri, 29 Apr 2016 07:13:17 -0400https://answers.axonivy.com/questions/1756/inconveniences-when-using-inner-classes-in-ivy-scriptinner-classivyscriptHow can I create an ivy Test User from a registeration page ?https://answers.axonivy.com/questions/1552/how-can-i-create-an-ivy-test-user-from-a-registeration-page<p>Hello everybody,</p> <p>How can I create a test user in the ivy designer from a registration page(html dialog) ? Is there a way with ivy scrip ? </p> <p>Thanks for your awnsers, Patrick Bühlmann</p>PatrickThu, 12 Nov 2015 16:48:04 -0500https://answers.axonivy.com/questions/1552/how-can-i-create-an-ivy-test-user-from-a-registeration-pageivyscriptdesigneruserHow to start an ivy script method from the main panel in a component?https://answers.axonivy.com/questions/1520/how-to-start-an-ivy-script-method-from-the-main-panel-in-a-component<p>Hello everybody!</p> <p>I have a problem in my ivy-project. In my main HTMl dialog panel, I add dynamically 8 rows(component)(ui:repeat). <br> I would like to call a ivy script method(in the component) from the main panel with a button click event.</p> <p>Is this possible and if so how can i make this? </p> <p>Thanks for your help, Patrick</p>PatrickMon, 19 Oct 2015 12:17:20 -0400https://answers.axonivy.com/questions/1520/how-to-start-an-ivy-script-method-from-the-main-panel-in-a-componentivyscriptcomponentHow to use content with contents in ScriptSteps?https://answers.axonivy.com/questions/1415/how-to-use-content-with-contents-in-scriptsteps<p>I have a Label (cms content) which holds other labels. The content of my label looks like that:</p> <pre><code>&lt;%=ivy.cms.co("/Labels/Labels/username")%&gt; or &lt;%=ivy.cms.co("/Labels/Labels/password")%&gt; is incorrect. </code></pre> <p>It works fine in JSF UI's with this code:</p> <pre><code>"#{ivy.cms.co('/Labels/Messages/loginFailedMsg')}" </code></pre> <p>But if I fill a process variable over a ScriptStep like this...</p> <pre><code>out.message = ivy.cms.co("/Labels/Messages/loginFailedMsg"); </code></pre> <p>... the integrated contents are not rendered.</p> <p>Is there a way to get the fully rendered label in a ScriptStep?</p>Adrian ImfeldTue, 28 Jul 2015 11:36:32 -0400https://answers.axonivy.com/questions/1415/how-to-use-content-with-contents-in-scriptstepsivyscriptcmsGet process data of a delayed taskhttps://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task<p>I start cases via a trigger element with a delay (blocking period) and some parameters. In another prozess I query this delayed tasks an want to retrieve the parameters with the getStartProcessData() method like with other running tasks. But the method here returns always null. Is there a way to get the input parameter of a delayed started case?</p>Peter WeberThu, 09 Jul 2015 09:06:37 -0400https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-taskcaseivyscripttaskHow to access data of a htmlUserDialog in java classhttps://answers.axonivy.com/questions/1360/how-to-access-data-of-a-htmluserdialog-in-java-class<p>Hi all Now i'm using HtmlUserDialog in ivy 5 and i have a situation need your help. As you know now when we have a HtmlUserDialog, it contain 4 parts: interface, view, logic &amp; data. Data can be accessed by keyword data (ex: data.username}, but it just work on Ivy Scrip step</p> <p>So now i want to do the same behaviour in java class (access to data of htmlUserDialog)</p> <p>Can anyone have tried before? Please help me a solution.</p> <p>Thanks in advance</p>trungdvMon, 15 Jun 2015 06:18:20 -0400https://answers.axonivy.com/questions/1360/how-to-access-data-of-a-htmluserdialog-in-java-classhtmluserdialogivyscriptList converted from an Enum array in Ivy Script doesn't work correctlyhttps://answers.axonivy.com/questions/1224/list-converted-from-an-enum-array-in-ivy-script-doesn-t-work-correctly<p>Today I found something looks like a bug in Ivy Script.</p> <p>In Ivy Script, I want to have a <code>List</code> of all the elements of an <code>enum</code>, say <code>WorkflowPriority</code>, I simply call <code>WorkflowPriority.values()</code>. However, the instance of <code>List</code> returned by the call doesn't work correctly, especially with operation <code>contains</code> and <code>remove</code>.</p> <p>Here are the tests that I made to check:</p> <p>(This is an Ivy Script snippet)</p> <pre><code>import org.junit.Assert; import com.genzerhawherk.bugs.Lists; import ch.ivyteam.ivy.workflow.WorkflowPriority; // Below are all failed tests Assert.assertTrue(WorkflowPriority.values().contains(WorkflowPriority.HIGH)); List&lt;WorkflowPriority&gt; withGenerics = WorkflowPriority.values(); Assert.assertTrue(withGenerics.contains(WorkflowPriority.HIGH)); List fromEnums = Lists.fromEnums(WorkflowPriority.class); Assert.assertTrue(fromEnums.contains(WorkflowPriority.HIGH)); List fromEnumVarargs = Lists.enumVarArgs(WorkflowPriority.HIGH, WorkflowPriority.EXCEPTION); Assert.assertTrue(fromEnumVarargs.contains(WorkflowPriority.HIGH)); // Below are all passed tests List listComprehensive = [WorkflowPriority.HIGH]; Assert.assertTrue(listComprehensive.contains(WorkflowPriority.HIGH)); List newPriorities = new List().addAll(WorkflowPriority.values()); Assert.assertTrue(newPriorities.contains(WorkflowPriority.HIGH)); List fromList = Lists.toArray([WorkflowPriority.HIGH]); Assert.assertTrue(fromList.contains(WorkflowPriority.HIGH)); List fromVarArgs = Lists.normalVarArgs(WorkflowPriority.HIGH); Assert.assertTrue(fromVarArgs.contains(WorkflowPriority.HIGH)); List&lt;WorkflowPriority&gt; manuallyConstructed = new List&lt;WorkflowPriority&gt;(); manuallyConstructed.add(WorkflowPriority.HIGH); Assert.assertTrue(manuallyConstructed.contains(WorkflowPriority.HIGH)); </code></pre> <p><strong>The bug particularly relates to converting <code>&lt;T extends Enum&lt;T&gt;&gt; T[]</code> into a <code>List&lt;T&gt;</code></strong></p> <p>Below is the class <code>Lists</code> I use in the test</p> <pre><code>public class Lists { public static Object[] toArray(Collection&lt;?&gt; collection) { return collection.toArray(); } @SafeVarargs public static &lt;T&gt; T[] normalVarArgs(T...elements) { return Arrays.copyOf(elements, elements.length); } public static &lt;T extends Enum&lt;T&gt;&gt; T[] fromEnums(Class&lt;T&gt; enums) { return enums.getEnumConstants(); } @SafeVarargs public static &lt;T extends Enum&lt;T&gt;&gt; T[] enumVarArgs(T...enums) { return enums; } } </code></pre>Genzer HawkerThu, 12 Mar 2015 08:27:40 -0400https://answers.axonivy.com/questions/1224/list-converted-from-an-enum-array-in-ivy-script-doesn-t-work-correctlyivyscriptenumlistarrayHow to dynamically open tab which binds a ivycomponent?https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponent<p>My team got some problems with adding a new p:tab which contains ivycomponent. In the first tab of the p:tabview contains a p:datatable. A new p:tab should created/opened each time if the user clicks a row in the datatable. </p> <p>In the new p:tab should include a ivycomponent with 2 parameters, which looks like following: <img alt="alt text" src="http://answers.axonivy.com/upfiles/ScreenHunter_352_Mar._05_10.34.jpg"></p> <p>Has anyone already gained experience with loading ivycomponent(s) within a dynamic p:tab? Thank you for sharing!</p> <p>Kind regards</p> <p>NWK Team</p>nwk2TeamThu, 05 Mar 2015 11:01:22 -0500https://answers.axonivy.com/questions/1202/how-to-dynamically-open-tab-which-binds-a-ivycomponenthtmluserdialogivyscriptprimefacesHow do I send html formated content in email step?https://answers.axonivy.com/questions/1151/how-do-i-send-html-formated-content-in-email-step<p>Hello</p> <p>How can I send formated emails? Assume I have an html-formated String and whant to bring it into my email. Problem here is that even this method will escape the String:</p> <p><code>&lt;%=ivy.html.getObject("in.mailString").toString()%&gt;</code></p> <p>Is there an other possibility to send the content of a JSP-Page?</p> <p>Best regards</p> <p>Alexis</p>AlexisMon, 09 Feb 2015 18:56:24 -0500https://answers.axonivy.com/questions/1151/how-do-i-send-html-formated-content-in-email-stepivyscriptjspChaining checking for initialization in Ivy Scripthttps://answers.axonivy.com/questions/890/chaining-checking-for-initialization-in-ivy-script<p>In the Ivy Designer Guide, Chapter 7, section Null handling / Automatic object creation, it states</p> <p>You can to use the .# operator to suppress the automatic object creation. </p> <pre><code>if( in.#customer == null) { // object is null } if (in.#customer is initialized) { // object is not null or has been set to a non-default value } </code></pre> <p>I also discover that we can do a chain of suppresing initialization like this:</p> <pre><code>if (in.#bigDataClass.#smallerDataClass.#smallDataClass.#tinyDataClass.#fieldXyz is initialized) { // Reach here if all of the properties are initialized } else { // Reach here if any of the properties are null } </code></pre> <p>This really reduces the verbosity of the code when I want to check a deep structure of data classes. Despite its usefulness, I cannot find any (Ivy) documentation mentioning about this feature. I only discovered it by chance and have been using it until now.</p> <p>My question is whether this is an official feature but has been forgotten to mention or it is an unofficial/hidden feature and could be dropped in the future?</p> <p>Thanks &amp; Regards</p>Genzer HawkerMon, 04 Aug 2014 11:35:59 -0400https://answers.axonivy.com/questions/890/chaining-checking-for-initialization-in-ivy-scriptivyscriptauto-initializationError on creating a typed Map in Ivyscript (Ivyscript and Generics)https://answers.axonivy.com/questions/878/error-on-creating-a-typed-map-in-ivyscript-ivyscript-and-generics<p>If I create a typed Map in a script step, (e.g. <code>Map&lt;Integer, String&gt; map = new HashMap&lt;Integer,String&gt;();</code>) I get the error "Unexpected token: ','".</p> <p><img alt="alt text" src="/upfiles/[1406105117]HashMap_7.png"></p> <p>Nevertheless the code compiles and the process can be executed. Why does this error appear on the script step?</p>Barbara BruggerWed, 23 Jul 2014 16:44:16 -0400https://answers.axonivy.com/questions/878/error-on-creating-a-typed-map-in-ivyscript-ivyscript-and-genericsivyscriptHow to handle expired date in ivytaskhttps://answers.axonivy.com/questions/808/how-to-handle-expired-date-in-ivytask<p>Hello everybody</p> <p>We are working with ivy task and we have requirement to send an email to member for the case the date of the task creation was [x] days ago (user can configure this period).Actually we can do that request by using automatic process but i just saw some strange parts in ivy task (red border in below picture) it might have us. I don't have experience about that. What is it used for? We can use it for our requirement?</p> <p>Anybody can help us?</p> <p>Thanks you</p> <p><img alt="alt text" src="/upfiles/ivy_task.jpg"></p>trungdvMon, 23 Jun 2014 05:15:38 -0400https://answers.axonivy.com/questions/808/how-to-handle-expired-date-in-ivytaskivyscripttaskCan i check what libraries were imported but not used it ivy scriplet?https://answers.axonivy.com/questions/762/can-i-check-what-libraries-were-imported-but-not-used-it-ivy-scriplet<p>Hello all Currently we take over a big project from other team and it had a large logic already. So our team found that in some scriptlet the old team imported some strange lib in scriplet but not used at any places. So my team really want to remove it as we can do in eclipse with Ctrl+O. How can we do that in ivy scriplet? Thanks in advance</p>trungdvTue, 10 Jun 2014 11:19:39 -0400https://answers.axonivy.com/questions/762/can-i-check-what-libraries-were-imported-but-not-used-it-ivy-scripletivyscriptjavaSending Daily Task Summary Email more than once a dayhttps://answers.axonivy.com/questions/715/sending-daily-task-summary-email-more-than-once-a-day<p>Hello,</p> <p>I want to send the daily tasksummary Email more than once a day.</p> <p>Is it possible to call the function of ivy Server bei ivy script? Starting the process of the WorkflowUi "only" gives me the HMTL page back</p> <p>Thanks Roland</p>rolandWed, 21 May 2014 21:11:45 -0400https://answers.axonivy.com/questions/715/sending-daily-task-summary-email-more-than-once-a-dayivyscriptHow 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-mailivyscriptapiDeserialization of Java Bean not possible within an ivy Script Elementhttps://answers.axonivy.com/questions/545/deserialization-of-java-bean-not-possible-within-an-ivy-script-element<p>ivy 5.0.9</p> <p>I created an Helper Class which should serialize / deserialize a Java Bean with the java.beans.XMLEncoder / XMLDecoder Class. Serialization works great, but if I want to deserialize the xml string within an Ivy Script Element, I got the following Error: java.lang.ArrayIndexOutOfBoundsException: 0</p> <p>If I do the deserialization within the Helper Class itself (as described as follows), the deserialization works great. Is there a way to bring it working within the Ivy Script Step?</p> <p>Thanks in advance for your ideas...</p> <h2>Helper Class "decode"</h2> <pre><code>public Employee decode(String xml) { try { XMLDecoder decoder = new XMLDecoder(IOUtils.toInputStream(xml, "UTF-8")); Employee employee = (Employee) decoder.readObject(); decoder.close(); return employee; } catch (Exception ex) { Ivy.log().error(ex.getMessage(), xml); return null; } } </code></pre> <h2>Calling the method using Ivy Script Step (Not working)</h2> <pre><code>import test.XmlHelper; import test.Employee; try { XmlHelper xh = new XmlHelper(); in.employee = xh.decode(in.usrData); /* (in.employee is a DataClass Attr. of type Employee in.usrData is a DataClass Attr. of type String containing the xml String) */ } catch (Exception ex) { in.errmsg = ex.getMessage(); } </code></pre> <h2>Calling the method directly in the Helper Class by main method (Works great)</h2> <pre><code>public static void main(String[] args) { XmlHelper xh = new XmlHelper(); Employee employee = new Employee(); employee = xh.decode("&lt;java version='1.7.0_17' class='java.beans.XMLDecoder'&gt;&lt;object class='test.Employee'&gt;&lt;void property='firstName'&gt;&lt;string&gt;Vorname&lt;/string&gt;&lt;/void&gt;&lt;void property='lastName'&gt;&lt;string&gt;Nachname&lt;/string&gt;&lt;/void&gt;"); System.out.println(employee.getFirstName()); System.out.println(employee.getLastName()); </code></pre> <p>}</p> <h2>Bean Employee (in ivy located under /src/test/entity )</h2> <pre><code>package test.entity; import java.io.Serializable; public class Employee implements Serializable { private static final long serialVersionUID = 1L; private String lastname = ""; private String firstname = ""; public String getLastName() { return lastname; } public void setLastName(String lastname) { this.lastname = lastname; } public String getFirstName() { return firstname; } public void setFirstName(String firstname) { this.firstname = firstname; } </code></pre> <p>}</p>StefanMon, 24 Feb 2014 14:24:39 -0500https://answers.axonivy.com/questions/545/deserialization-of-java-bean-not-possible-within-an-ivy-script-elementdeserializationivyscriptGeneric classes in ivyscripthttps://answers.axonivy.com/questions/531/generic-classes-in-ivyscript<p>Hello IvyTeam</p> <p>Is there a simple way calling self made generic classes? Like the List.</p> <p>Data:<br> dao Dao&lt;item&gt;</p> <p>in Ivyscript:<br> calling dao.get(id) the response would be of type Item.</p> <p>generic Class:<br> T get(int id)</p> <p>It would be great if there is a solution.</p> <p>Thanks for an answer and Greetings</p> <p>Edit: Trying to extend a class with the Generic doesn't help any further.<br> In java code those objects return items as it should and in ivyscript Objects are still returned.</p> <pre><code>public class DaoItemTest extends Dao&lt;Item&gt; { public DaoItemTest() { super(Item.class); } } </code></pre>AlexisWed, 19 Feb 2014 13:18:14 -0500https://answers.axonivy.com/questions/531/generic-classes-in-ivyscriptivyscriptHow to reset permissions of an user or role?https://answers.axonivy.com/questions/58/how-to-reset-permissions-of-an-user-or-role<p>In our project we set specific permissions to the application users and/or groups. Now we have the requirement to reset them to the default permissions.</p> <p>Is there a functionality directly in the UI or exists a public API?</p>Flavio SadeghiFri, 08 Nov 2013 11:36:01 -0500https://answers.axonivy.com/questions/58/how-to-reset-permissions-of-an-user-or-roleivyscriptadministrationHow to work with java.util.Date in IvyScript-Step without auto initializationhttps://answers.axonivy.com/questions/52/how-to-work-with-java-util-date-in-ivyscript-step-without-auto-initialization<p>In an IvyScriptStep variables are auto initialized as soon as they are accessed. The following code will log "bad":</p> <pre><code>java.util.Date date = null; if ( date!=null) { ivy.log.info("bad"); } else { ivy.log.info("good"); } </code></pre> <p>It looks like the object "date" will never be a java.util.Date, it is an IvyDate. There is also no chance to import java.util.Date because of a conflict.</p>Adrian ImfeldWed, 06 Nov 2013 14:42:43 -0500https://answers.axonivy.com/questions/52/how-to-work-with-java-util-date-in-ivyscript-step-without-auto-initializationivyscriptHow to convert a List to a Recordset?https://answers.axonivy.com/questions/47/how-to-convert-a-list-to-a-recordset<p>When migrating projects from version 3.x to 4.x or 5.x some APIs has changed and calls has to be rewritten.</p> <p>In versions &gt; 4.x most APIs returns List, however similar APIs in 3.x returns Recordsets.</p> <p>Therefore, what is the easiest way to convert a List (of a specific type) to a Recordset, so that I only has to change the calls and I do not have to touch the existing process?</p>Flavio SadeghiThu, 31 Oct 2013 14:30:22 -0400https://answers.axonivy.com/questions/47/how-to-convert-a-list-to-a-recordsetivyscriptivy3x-migrationSwitch Case statement in ivyScripthttps://answers.axonivy.com/questions/390/switch-case-statement-in-ivyscript<p>I would like to use switch case like I can use it in Java in ivyScript. But I get validation errors if I use it. Do I have to take care about a special syntax? </p>Lars WinnatThu, 10 Feb 2011 05:53:24 -0500https://answers.axonivy.com/questions/390/switch-case-statement-in-ivyscriptivyscriptjavaCasting in ivyScripthttps://answers.axonivy.com/questions/341/casting-in-ivyscript<p>I need to call a method on certain componentes within a rich dialog panel. I get all components of the panel and then loop over them like this: </p> <pre><code>List&lt;ULCComponent&gt; listComponent = panel.getComponents(); for(int i = 0; i &lt; listComponent.size(); i++){ if(listComponent.get(i) instanceof RLabel){ RLabel label = (RLabel) listComponent.get(i); ((RLabel) listComponent.get(i)).setVisible(in.showLabel); } } </code></pre> <p>In both lines with the casting I get exceptions:</p> <pre><code>Unexpected token: identifier 'listComponent' </code></pre> <p>What is wrong?</p>Dirk BusmannThu, 18 Mar 2010 08:48:28 -0400https://answers.axonivy.com/questions/341/casting-in-ivyscriptivyscript