Questions asked by Björnhttps://answers.axonivy.com/questions/asked-by/29/bj%C3%B6rn/?type=rssQuestions asked by <a href="/users/29/bj%C3%B6rn" >Björn</a>enWed, 21 Oct 2015 12:13:54 -0400Creating a new user programmaticallyhttps://answers.axonivy.com/questions/1525/creating-a-new-user-programmatically<p>Hi</p>
<p>I would like to realize the following scenario: Let's say, we have a website publicaly accessible (e-gov-platform). There is a link to a Process Start (HTTP Request). The first activity of this process should be a login/registration form. If the user has already an account, he should be able to login with username and password (for this part <a href="http://answers.axonivy.com/questions/1515/login-page-on-process-start-with-http-request-link-and-only-wf-users-set-to-true">this answer</a> is helpful). If not, he should be able to register a new user with a typical registration form. And here I'm stucked: In the public API I cannot find a method to create a new user. Am I searching in the wrong direction?</p>
<p>Kind regards
Björn</p>BjörnWed, 21 Oct 2015 12:13:54 -0400https://answers.axonivy.com/questions/1525/creating-a-new-user-programmaticallyuserGetting 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<betreibung>", 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-webservicelistwebserviceCalling REST Webservice (HTTP GET)https://answers.axonivy.com/questions/527/calling-rest-webservice-http-get<pre><code>I'm trying to use a currency converter in Xpert.ivy: http://rate-exchange.appspot.com. This service is called like this: http://rate-exchange.appspot.com/currency?from=EUR&to=CHF and gives a response like this: {"to": "CHF", "rate": 1.2223900000000001, "from": "EUR"}.
I would like this to call in a script step. So far I tried the method described in http://www.javacodegeeks.com/2012/09/simple-rest-client-in-java.html:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("http://rate-exchange.appspot.com/currency?from=EUR&to=CHF");
HttpResponse response = client.execute(request);
BufferedReader rd = new BufferedReader (new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
out.SOME_STRING_DATATYPE = line;
}
</code></pre>
<p>At execution this throws an error in line 'HttpResponse response = client.execute(request);'</p>
<p>Is there a better method to use a REST webservice from within Xpert.ivy?</p>BjörnTue, 18 Feb 2014 17:52:38 -0500https://answers.axonivy.com/questions/527/calling-rest-webservice-http-getrestHow to switch between java.io.File and ivy.scripting.objects.File?https://answers.axonivy.com/questions/199/how-to-switch-between-java-io-file-and-ivy-scripting-objects-file<p>From the Xpert.ivy help I succeeded in converting a ivy File Object to an Java File Object by using...</p>
<pre><code>java.io.File tempFile = in.someIvyFileObjectInstance.getJavaFile();
</code></pre>
<p>But what about the inverse way: Java File -> Ivy File? I didn't found a solution for this.</p>BjörnThu, 12 Dec 2013 16:56:28 -0500https://answers.axonivy.com/questions/199/how-to-switch-between-java-io-file-and-ivy-scripting-objects-filejavafileContent of question doesn't show uphttps://answers.axonivy.com/questions/173/content-of-question-doesn-t-show-up<p>I posted a <a href="http://answers.xpertivy.ch/questions/172/xmlstreamexception-while-calling-a-soap-webservice">question</a> minutes ago. In the edit window I can see text and pictures, but in the finished version the question is empty. <a href="https://dl.dropboxusercontent.com/u/158270/TEMP_Xpertivy_Problem.docx">Here</a> is the same question copied to a word document.</p>BjörnFri, 06 Dec 2013 14:10:02 -0500https://answers.axonivy.com/questions/173/content-of-question-doesn-t-show-upquestion_and_answerXMLStreamException while calling a SOAP webservicehttps://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice<pre><code>I want to use a webservice, which I created in Inubit. The WSDL URL is [http://venus.zhaw.ch:8000/ibis/ws/Betreibungsregisterauszug_ws_Listener?wsdl][1]. When I test the service in [soapUI][2] everything works fine (see picture).
</code></pre>
<p><img alt="alt text" src="/upfiles/picture1.png"></p>
<pre><code>When I test the service in Xpert.ivy Designer 5.1.0 S6, I get the error javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT. What could be the reason for this error?
</code></pre>
<p><img alt="alt text" src="/upfiles/picture2.png"></p>
<p><img alt="alt text" src="/upfiles/picture3.png"></p>
<pre><code>Here is the XML Request in soapUI:
POST http://venus.zhaw.ch:8000/ibis/ws/Betreibungsregisterauszug_ws_Listener HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "BetreibungsregisterauszugErhalten"
Content-Length: 352
Host: venus.zhaw.ch:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener">
<soapenv:Header/>
<soapenv:Body>
<bet:BetreibungsregisterauszugErhalten>CH450234</bet:BetreibungsregisterauszugErhalten>
</soapenv:Body>
</soapenv:Envelope>
</code></pre>
<ul>
<li><a href="http://youtu.be/HhWzQLEylII?hd=1">Link to screencast explaining the problem (german only)</a></li>
<li><a href="http://youtu.be/uKkJFXZ98P0?hd=1">Link to 2nd screencast with new findings</a></li>
<li><a href="https://www.dropbox.com/s/6zxd079rdh8ih3p/TEMPTestWebservice.iar">Link to Xpert.ivy project (iar-file)</a></li>
</ul>BjörnFri, 06 Dec 2013 14:03:36 -0500https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservicexmlwebserviceBest 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-looplistloopException Handling: How to get the error messagehttps://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message<p>How can I access the exception message in a exception start process element?</p>
<p>Original Question (in German only):</p>
<p>Ich versuche für unsere Studierenden (Unterricht an der ZHAW) eine möglichst generische Fehlerbehandlung aufzuzeigen. Folgendes schwebt mir vor:</p>
<ol>
<li>Siehe erstes Bild. Pro Prozess füge ich einen Pool 'Fehlerbehandlung' (1) mit einem Lane pro Fehlerquelle hinzu (z.B. 'DB Step Exception) (2)</li>
<li>In diesem Lane gibt es ein Exception Start-Element (3)</li>
<li>Innerhalb des Prozesses kann ich nun überall dieses Start-Element als Exception Handling verwenden, wo es passt (4, 5, 6)</li>
<li>Das Exception Handling selbst soll zunächst einmal darin bestehen, eine aussagekräftige Fehlermeldung anzuzeigen. Hierfür habe ich einen prozessübergreifenden Subprozess 'DisplayErrorPage' erzeugt (zweites Bild)</li>
<li>Innerhalb dieses Subprozesses möchte ich nun in Abhängigkeit des aufgetretenen Java-Fehlers (siehe zum Beispiel drittes Bild) über eine unterschiedliche Fehlermeldung reagieren. <strong>Zu diesem Zweck müsste ich aber programmatisch irgendwie auf die Error Message (z.B. drittes Bild) zugreifen können. Wie kann ich dies bewerkstelligen?</strong> Ich vermutete zunächst, dass dies ein Objekt in der ivy-Hierarchie ist, fand aber nichts.</li>
</ol>
<p>Ich wäre sehr froh um eine Antwort bis 13.11. 12 Uhr, damit ich rechtzeitig ein Video für die Studierenden erstellen kann.</p>
<p><img alt="A" src="/upfiles/A.png">
<img alt="B" src="/upfiles/B.png">
<img alt="C" src="/upfiles/C.png"></p>BjörnMon, 11 Nov 2013 16:04:06 -0500https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-messageexceptionhandling