Questions Tagged With listhttps://answers.axonivy.com/tags/list/?type=rssquestions tagged <span class="tag">list</span>enFri, 17 Jun 2016 15:53:54 -0400DB Table to populate a List of valueshttps://answers.axonivy.com/questions/1823/db-table-to-populate-a-list-of-values<p>Hi all,</p> <p>I'm newbie about AI designer. I'm trying to do something that it should be easy. I want to load a list of values in a Dialog (selectOneMenu) from a DB table. Suppose I have some employees. I want to create a new employee, so I need to assign it to amn existing department. So, I need an object List&lt;department&gt; in the Dialog interface to use it in the selectOneMenu control and save department code when I save this employee data to database.</p> <p>I'm not finding the way to connect the DB step when I make this query to the dialog step.</p> <p>Can you help me? Any documentation about this kind of tasks?</p> <p>BR</p>jirazazabalFri, 17 Jun 2016 15:53:54 -0400https://answers.axonivy.com/questions/1823/db-table-to-populate-a-list-of-valuesdesignerlistList 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 get the users tasklisthttps://answers.axonivy.com/questions/969/how-to-get-the-users-tasklist<p>How can i get the task list of the current logged in user without the permission TaskReadAll.</p> <p>All methods i tried call <b>getTaskQueryExecutor</b> which needs the permission TaskReadAll.</p> <p>I think the User should be allowed to read it's own tasks.</p>HaraldWeberThu, 18 Sep 2014 14:12:03 -0400https://answers.axonivy.com/questions/969/how-to-get-the-users-tasklisttasklistGetting a list as a result from an ivy webservicehttps://answers.axonivy.com/questions/621/getting-a-list-as-a-result-from-an-ivy-webservice<p>I created a webservice in ivy, which requests a string as input parameter and returns as result a string and a list (of a custom data class Betreibung).</p> <p>I can call this webservice from another ivy project and save the result in corresponding attributes. But as I can only save the list result "as List" and not "as List&lt;betreibung&gt;", every resulting List element is not of the class "Betreibung" but of the class "namespace.unknown.Betreibung". For this reason I cannot use the saved list entries later on.</p> <p>I created a short video to clarify my problem (in german only):</p> <pre><code>http://youtu.be/qWRUfq9i-xo?hd=1 </code></pre>BjörnWed, 09 Apr 2014 11:40:46 -0400https://answers.axonivy.com/questions/621/getting-a-list-as-a-result-from-an-ivy-webservicelistwebserviceBest Practice for filling a List in a loophttps://answers.axonivy.com/questions/105/best-practice-for-filling-a-list-in-a-loop<p>I'm using Xpert.ivy Designer 5.1.0 (Lauberhorn) S6. I tried to fill a List in a loop: </p> <ol> <li>In a form I ask the user, how many entries the list will have (numberOfIterations)</li> <li>With an Alternative Switch element I'm ensuring, that the following steps are executed as often as the defined number of iterations:</li> <li>In a form I ask the user for the attributes of the list entry (attribute one, attribute two)</li> <li>In three different variants I add the new list entry to the list. Only the most time consuming variant works. The other variants don't work as expected. I suppose, this is a bug.</li> </ol> <p>To better understand, please watch the <a href="http://youtu.be/PAn626HnR-Q?hd=1">screencast on YouTube</a> (2 minutes).</p> <p>An answer until 25.11. evening would be very appreciated.</p> <p>[EDIT]: <strong>Here the <a href="https://dl.dropboxusercontent.com/u/158270/TEMP_ZHAW_HS13/FillListInLoop.iar">link to the iar-File</a> for testing.</strong></p>BjörnFri, 22 Nov 2013 10:52:25 -0500https://answers.axonivy.com/questions/105/best-practice-for-filling-a-list-in-a-looplistloop