I am attempting to configure our build process so that build exceptions only get emailed to the buildmanager.
I must be doing something wrong because even though I have the groups well defined and everyone gets mailed the exception emails.
Below is a code segment showing my current structure. This emailconfig.xml file is imported into my projects. Is there something I am missing in my understanding how notificationType should be used? Thank you.
<cb:config-template xmlns:cb="urn:ccnet.config.builder">
<email from="$(MAIL_FROM)" mailhost="$(MAIL_HOST)" mailport="25" includeDetails="TRUE">
<users>
<user name="DevTeam" group="developers" address="ACDev#companyname.com"/>
<user name="QA-OnPrem" group="QA" address="QA-OnPrem#companyname.com"/>
<user name="BuildManagers" group="buildmaster" address="ACBuilds#companyname.com"/>
<user name="Some Name" group="BA" address="sname#companyname.com"/>
</users>
<groups>
<group name="buildmaster">
<notifications>
<notificationType>Always</notificationType>
</notifications>
</group>
<group name="developers">
<notifications>
<notificationType>Failed</notificationType>
<NotificationType>Success</NotificationType>
<NotificationType>Change</NotificationType>
</notifications>
</group>
<group name="QA">
<notifications>
<notificationType>Failed</notificationType>
<NotificationType>Success</NotificationType>
<NotificationType>Change</NotificationType>
<NotificationType>Fixed</NotificationType>
</notifications>
</group>
<group name="BA">
<notifications>
<notificationType>Change</notificationType>
<notificationType>Fixed</notificationType>
</notifications>
</group>
<group name="PHITeam">
<notifications>
<notificationType>Failed</notificationType>
<NotificationType>Success</NotificationType>
<NotificationType>Change</NotificationType>
<NotificationType>Fixed</NotificationType>
</notifications>
</group>
</groups>
<modifierNotificationTypes>
<NotificationType>Failed</NotificationType>
<NotificationType>Fixed</NotificationType>
<NotificationType>Success</NotificationType>
<NotificationType>Change</NotificationType>
<NotificationType>Exception</NotificationType>
</modifierNotificationTypes>
<xslFiles>
<file>xsl\header.xsl</file>
<file>xsl\compile.xsl</file>
<file>xsl\modifications.xsl</file>
</xslFiles>
</email>
</cb:config-template>
you have the buildmaster receiving all mails, and the modifiers also
below is a setup I use, and that one works great. It has less groups than you, but you'll get the idea.
<cb:define name="email_publisher">
<email from="CruiseControl#xyz.com"
mailhost="mailserver"
includeDetails="TRUE">
<users>
<user name="Ruben Willems" group="buildmaster" address="ruben.willems#whatever.com" />
</users>
<groups>
<group name="buildmaster" >
<notifications>
<NotificationType>Exception</NotificationType>
</notifications>
</group>
</groups>
<converters>
<ldapConverter domainName="FortKnox" ldapQueryField="displayName" />
</converters>
<modifierNotificationTypes>
<NotificationType>Failed</NotificationType>
<NotificationType>Fixed</NotificationType>
</modifierNotificationTypes>
</email>
Related
We've been asked to migrate some very old legacy projects (i.e. from TFS 2010 days) onto Azure Devops Services. These very old projects have almost nothing in their Process Configuration and only have one error line in the logs from the migration tool for all project types (Scrum, Agile, Basic etc...).
[Info #15:27:48.998] === Found 1 error(s) when compared against process TFS 2019 Update 1 Scrum ===
[Error #15:27:48.998] Custom processConfiguration typeField count '0' is different than system '8'.
[Info #15:27:48.998] === End of error(s) when compared against process TFS 2019 Update 1 Scrum ===
When looking at their Process Configuation it is only a few lines:
<?xml version="1.0" encoding="utf-16"?>
<ProjectProcessConfiguration>
<RequirementBacklog workItemCountLimit="1000">
<AddPanel />
</RequirementBacklog>
<TaskBacklog workItemCountLimit="1000">
<AddPanel />
</TaskBacklog>
<Properties>
<Property name="BugsBehavior" value="Off" />
</Properties>
</ProjectProcessConfiguration>
The only project that has no errors was a project added much later on TFS 2015:
<?xml version="1.0" encoding="utf-16"?>
<ProjectProcessConfiguration>
<BugWorkItems category="Microsoft.BugCategory" pluralName="Bugs" singularName="Bug">
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
<State type="Resolved" value="Resolved" />
</States>
</BugWorkItems>
<FeedbackRequestWorkItems category="Microsoft.FeedbackRequestCategory" pluralName="Feedback Requests" singularName="Feedback Request">
<States>
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
</States>
</FeedbackRequestWorkItems>
<FeedbackResponseWorkItems category="Microsoft.FeedbackResponseCategory" pluralName="Feedback Responses" singularName="Feedback Response">
<States>
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
</States>
</FeedbackResponseWorkItems>
<PortfolioBacklogs>
<PortfolioBacklog category="Microsoft.EpicCategory" pluralName="Epics" singularName="Epic" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.Effort" />
<Column width="50" refname="Microsoft.VSTS.Common.BusinessValue" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="Complete" value="Closed" />
</States>
</PortfolioBacklog>
<PortfolioBacklog category="Microsoft.FeatureCategory" parent="Microsoft.EpicCategory" pluralName="Features" singularName="Feature" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.Effort" />
<Column width="50" refname="Microsoft.VSTS.Common.BusinessValue" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="Complete" value="Closed" />
</States>
</PortfolioBacklog>
</PortfolioBacklogs>
<RequirementBacklog category="Microsoft.RequirementCategory" parent="Microsoft.FeatureCategory" pluralName="Stories" singularName="User Story" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="100" refname="System.WorkItemType" />
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.StoryPoints" />
<Column width="100" refname="Microsoft.VSTS.Common.ValueArea" />
<Column width="200" refname="System.IterationPath" />
<Column width="200" refname="System.Tags" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="InProgress" value="Resolved" />
<State type="Complete" value="Closed" />
</States>
</RequirementBacklog>
<TaskBacklog category="Microsoft.TaskCategory" parent="Microsoft.RequirementCategory" pluralName="Tasks" singularName="Task" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="100" refname="System.AssignedTo" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.RemainingWork" />
</Columns>
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Active" />
<State type="Complete" value="Closed" />
</States>
</TaskBacklog>
<TypeFields>
<TypeField refname="Microsoft.VSTS.Common.Activity" type="Activity" />
<TypeField refname="Microsoft.VSTS.Common.StackRank" type="Order" />
<TypeField refname="Microsoft.VSTS.Feedback.ApplicationLaunchInstructions" type="ApplicationLaunchInstructions" />
<TypeField refname="Microsoft.VSTS.Feedback.ApplicationStartInformation" type="ApplicationStartInformation" />
<TypeField refname="Microsoft.VSTS.Feedback.ApplicationType" type="ApplicationType">
<TypeFieldValues>
<TypeFieldValue type="ClientApp" value="Client application" />
<TypeFieldValue type="RemoteMachine" value="Remote machine" />
<TypeFieldValue type="WebApp" value="Web application" />
</TypeFieldValues>
</TypeField>
<TypeField format="{0} h" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="RemainingWork" />
<TypeField refname="Microsoft.VSTS.Scheduling.StoryPoints" type="Effort" />
<TypeField refname="System.AreaPath" type="Team" />
</TypeFields>
<Weekends>
<DayOfWeek>Sunday</DayOfWeek>
<DayOfWeek>Saturday</DayOfWeek>
</Weekends>
<Properties>
<Property name="HiddenBacklogs" value="Microsoft.EpicCategory" />
<Property name="BugsBehavior" value="AsTasks" />
</Properties>
<WorkItemColors>
<WorkItemColor primary="FFCC293D" secondary="FFFAEAE5" name="Bug" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Code Review Request" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Code Review Response" />
<WorkItemColor primary="FFFF7B00" secondary="FFFFD7B5" name="Epic" />
<WorkItemColor primary="FF773B93" secondary="FFEEE2F2" name="Feature" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Feedback Request" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Feedback Response" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Issue" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Shared Parameter" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Shared Steps" />
<WorkItemColor primary="FFF2CB1D" secondary="FFF6F5D2" name="Task" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Test Case" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Test Plan" />
<WorkItemColor primary="FFFF9D00" secondary="FFFCEECF" name="Test Suite" />
<WorkItemColor primary="FF009CCC" secondary="FFD6ECF2" name="User Story" />
</WorkItemColors>
</ProjectProcessConfiguration>
Anyone know of a easy way to fix the older projects? We want to import the code with changeset histories into Azure Devop Services and none of them have actually have work items (was managed externally on JIRA), build and release configs etc... We just want to get them onto the cloud to retire the legacy onpremise TFS servers (which are now running Azure Devops Server 2020.1.1 as per the migration suggestions).
Thanks for any help.
Edit: we're using TFS Team Project Manager from Jelle Druyts to help do some of the analysis, and am wondering if we can use the Transform function under Process Configuration to import the working projects config into the other projects.
Mark.
Sorry for the late reply on this. Since we didn't need to preserve templates and work items/ task history, we ended up abandoning full migrations. Ended up using the git-tfs (https://git-tfs.com/) tool to convert the TFS projects to a local git repository, then attaching that to a new Azure git project. Preserved all our history which was great.
I would like to know how to add text type indexes in my ODM configuration by XML to solve this problem and search by name.
Thanks for everything.
Regards.
PD: I'm sorry for my English.
<document name="App\Document\Doc" db="db" collection="collection"
repository-class="App\Repository\DocRepository">
<id field-name="id" strategy="INCREMENT" type="int"/>
<field field-name="code" name="code" type="string"/>
<field field-name="name" name="name" type="string"/>
<field field-name="type" name="type" type="string"/>
<indexes>
???
</indexes>
</document>
After digging into some code I found this works:
<document name="App\Document\Doc" db="db" collection="collection"
repository-class="App\Repository\DocRepository">
<id field-name="id" strategy="INCREMENT" type="int"/>
<field field-name="code" name="code" type="string"/>
<field field-name="name" name="name" type="string"/>
<field field-name="type" name="type" type="string"/>
<indexes>
<index name="fts">
<key name="code" order="text" />
<key name="name" order="text" />
<key name="type" order="text" />
</index>
</indexes>
</document>
However the keyword order seems counterintuitive.
I am trying to map my MongoDB with the WSO2 DSS. But the service generated is faulty and getting many errors regarding the mapping of the data.
Here is what I tried:
<data name="MongoDB" transports="http https local">
<config enableOData="false" id="mongodb">
<property name="mongoDB_servers">127.0.0.1:27017</property>
<property name="mongoDB_database">domain_with_email</property>
<property name="mongoDB_write_concern">NONE</property>
<property name="mongoDB_read_preference">PRIMARY</property>
</config>
<query id="search" useConfig="mongodb">
<expression>domainemail.find({"domain":#})</expression>
<result escapeNonPrintableChar="true" outputType="json" useColumnNumbers="true">{
"entries":
{
"id":"$_id",
"domain":"$domain",
"emails":[
{
"email":"$email"
}
]
}
}</result>
<param defaultValue="yahoo.com" name="domain" sqlType="STRING"/>
</query>
<operation name="search">
<call-query href="search">
<with-param name="domain" query-param="domain"/>
</call-query>
</operation>
</data>
Here is the errors:
https://gist.github.com/JafferWilson/b4aa22c39205d61a25f2bee5b45a7607
Kindly let me know what I need to do to get a JSON output from my MongoDB using WSO2 DSS?
We're still struggling with our WSO2 + Mongo journey too. Anyhow I hope this can help. Here's our code for a working JSON service to MongoDB
<data name="MongoTestDS2" transports="http https local">
<config enableOData="false" id="MongoDS">
<property name="mongoDB_servers">xx.xx.xx.xx</property>
<property name="mongoDB_database">mydb</property>
</config>
<query id="GetTestVals" useConfig="MongoDS">
<expression>things.find()</expression>
<result element="Documents" rowName="Document" useColumnNumbers="true">
<element column="document" export="id" name="Data" xsdType="string"/>
</result>
</query>
<query id="InsertTestVals" returnUpdatedRowCount="true" useConfig="MongoDS">
<expression>things.insert("{id:#, name:#}")</expression>
<result element="UpdatedRowCount" rowName="" useColumnNumbers="true">
<element column="1" name="Value" xsdType="integer"/>
</result>
<param name="id" sqlType="STRING"/>
<param name="name" sqlType="STRING"/>
</query>
<query id="GetValsJson" useConfig="MongoDS">
<expression>things.find()</expression>
<result outputType="json">{
"Documents": {
"Document": [
{
"Data": "$document"
}
]
}
}</result>
</query>
<operation name="GetThings">
<description>Test Mongo DB
</description>
<call-query href="GetTestVals"/>
</operation>
<operation name="PutThings">
<call-query href="InsertTestVals">
<with-param name="id" query-param="id"/>
<with-param name="name" query-param="name"/>
</call-query>
</operation>
<operation name="GetThingsJson">
<call-query href="GetValsJson"/>
</operation>
</data>
In your case I think, it's this line you need to change:
<query id="GetValsJson" useConfig="MongoDS">
<expression>things.find()</expression>
<result outputType="json">{
"Documents": {
"Document": [
{
"Data": "$document"
}
]
}
}</result>
</query>
This returns all the fields into a string.
If this is then related to your earlier question, then I think this tutorial will help with the next step of mapping field from one service to another:
https://docs.wso2.com/display/EI611/Transforming+Message+Content
On our side, we unfortunately gave up on the mongodb adapter that comes with WSO2 and used RESTHeart to expose the mongodb as APIs (http://restheart.org/) This seems to work well as WSO2 then just consumes them as if they were any other REST API.
We'd love to hear how you get on as I'm sure we'll hit many of the same challenges in our own mongodb + WSO2 testing.
I have a main file that has toggle button, on clicking one of the button I launch a new FXMLLoader that has about 10 SVGs, 15 Textfield and 6 spinners. Additionally it has CSS to render nodes accordingly... It loads fine with no error or any issues but takes a sec or two before the scene is displayed.
I guess it's to due to the number of nodes getting initialized at the same time. Is there a way to get scene displayed before the nodes start to be initialized?
NOTE: My project requires me to navigate to different scene on click.
ToggleButton from where it is selected
if(settings.isSelected()){
Stage stage = (Stage) mainWrapper.getScene().getWindow();
Parent root = FXMLLoader.load(getClass().getResource("/fxmlFiles/settings.fxml"));
stage.setScene(new Scene(root, Screen.getPrimary().getVisualBounds().getWidth(),
Screen.getPrimary().getVisualBounds().getHeight()));
stage.centerOnScreen();
//stage.setMaximized(true);
stage.show();
}
fxmlFile
<FlowPane xmlns:fx="http://javafx.com/fxml"
fx:controller="controllers.motelInfoController"
stylesheets="/cssFiles/motelInfo.css"
fx:id="content">
<VBox fx:id="mainWrapper">
<VBox fx:id="validationWrapper">
<Label fx:id="validationLabel" visible="false"/>
</VBox>
<VBox fx:id="generalInfo">
<HBox> <!--First Row-->
<HBox>
<Group>
<SVGPath fx:id="iconMotelName" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miName" promptText="Motel Name"/>
</Group>
</HBox>
<HBox>
<Group>
<TextField fx:id="miFranchiseName" promptText="Franchise Name"/>
</Group>
</HBox>
</HBox>
<HBox> <!--Second Row-->
<HBox>
<Group>
<SVGPath fx:id="iconMotelAddress" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miAddress" promptText="Street Name"/>
</Group>
</HBox>
<HBox>
<Group>
<TextField fx:id="miCity" promptText="City/Town Name"/>
</Group>
</HBox>
</HBox>
<HBox><!--Third Row-->
<HBox style="-fx-spacing: 25px;">
<Label></Label> <!--Empty label for purpose of leaving icon gap since N/A here-->
<Group>
<TextField fx:id="miState" promptText="State"/>
</Group>
</HBox>
<HBox>
<Group>
<TextField fx:id="miZipCode" promptText="Zip Code"/>
</Group>
</HBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelContact" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miContact" promptText="Contact no."/>
</Group>
</HBox>
</HBox>
<HBox> <!--Fourth Row-->
<HBox>
<Group>
<SVGPath fx:id="iconMotelFax" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miFax" promptText="Fax no."/>
</Group>
</HBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelEmail" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miEmail" promptText="Email id"/>
</Group>
</HBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelNoOfRooms" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miNOR" promptText="No. of Rooms"/>
</Group>
</HBox>
</HBox>
<HBox style="-fx-spacing: 50px"> <!--Fifth Row-->
<HBox>
<Group>
<SVGPath fx:id="iconMotelCheckInTime" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<Spinner fx:id="hourSpinnerCIT"/>
</Group>
<Group>
<Spinner fx:id="minSpinnerCIT"/>
</Group>
<Group>
<Spinner fx:id="secSpinnerCIT"/>
</Group>
</HBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelCheckOutTime" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<Spinner fx:id="hourSpinnerCOT"/>
</Group>
<Group>
<Spinner fx:id="minSpinnerCOT"/>
</Group>
<Group>
<Spinner fx:id="secSpinnerCOT"/>
</Group>
</HBox>
</HBox>
</VBox>
<VBox fx:id="roomOccupancy">
<HBox> <!--First Row-->
<Label fx:id="labelMaxGuestSelection"
text="Maximum Allowed Guest in individual Rooms. Please state the max count in adjacent cells"/>
<VBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelSingleBed" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miSB" promptText="Single Bed"/>
</Group>
</HBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelTwoBeds" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miTB" promptText="Two Beds"/>
</Group>
</HBox>
<HBox>
<Group>
<SVGPath fx:id="iconMotelfamilyRoom" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miFR" promptText="Family Room"/>
</Group>
</HBox>
</VBox>
</HBox>
<HBox> <!--Second Row-->
<Label fx:id="labelMaxGuestCharged"
text="Rate Charged per Guest after max. allowed guest exceeds in a room"/>
<HBox>
<Group>
<SVGPath fx:id="iconMotelGuestExceedRate" scaleX="0.05" scaleY="0.05" fill="white"/>
</Group>
<Group>
<TextField fx:id="miGER" promptText="Rate/Guest Exceeded"/>
</Group>
</HBox>
</HBox>
</VBox>
<VBox fx:id="submissionWrapper">
<Group>
<Button fx:id="submit" text="UPDATE" onAction="#saveData"/>
</Group>
</VBox>
</VBox>
</FlowPane>
Controller for FXML
#Override
public void initialize(URL location, ResourceBundle resources) {
//Load the data if the motelInfo file exist
File checkTemp = new File("motelDetails.ser");
if(checkTemp.exists()){
readDataFromFile();
}
//Getting Values for the spinner
for(int i=0;i<24;i++){
hourList.add(String.format("%02d", i));
}
final SpinnerValueFactory<String> hourValuesCIT = new SpinnerValueFactory.ListSpinnerValueFactory<>(hourList);
final SpinnerValueFactory<String> hourValuesCOT = new SpinnerValueFactory.ListSpinnerValueFactory<>(hourList);
for(int i=0; i<60; i++){
minList.add(String.format("%02d", i));
secList.add(String.format("%02d", i));
}
final SpinnerValueFactory<String> minValuesCIT = new SpinnerValueFactory.ListSpinnerValueFactory<>(minList);
final SpinnerValueFactory<String> minValuesCOT = new SpinnerValueFactory.ListSpinnerValueFactory<>(minList);
final SpinnerValueFactory<String> secValuesCIT = new SpinnerValueFactory.ListSpinnerValueFactory<>(secList);
final SpinnerValueFactory<String> secValuesCOT = new SpinnerValueFactory.ListSpinnerValueFactory<>(secList);
styleSpinner(hourSpinnerCIT, hourValuesCIT);
styleSpinner(hourSpinnerCOT, hourValuesCOT);
styleSpinner(minSpinnerCIT, minValuesCIT);
styleSpinner(minSpinnerCOT, minValuesCOT);
styleSpinner(secSpinnerCIT, secValuesCIT);
styleSpinner(secSpinnerCOT, secValuesCOT);
}
It seems you have two problems:
running long operation (readDataFromFile()) on a UI Thread which blocks updates
doing it all in FXMLoader.load() which doesn't allow to draw anything until it finished
I suggest to fix both things by running load in a different thread and showing load screen while it happens. See next example:
public class Main extends Application {
#Override
public void start(Stage stage) throws Exception {
StackPane loadingRoot = new StackPane();
loadingRoot.getChildren().setAll(new ProgressIndicator());
final Scene scene = new Scene(loadingRoot);
stage.setWidth(400);
stage.setHeight(400);
stage.setScene(scene);
stage.show();
new Thread(() -> {
veryLongOperation();
// we need to wrap UI code in Platform
Platform.runLater(() -> {
Parent root;
try {
root = FXMLLoader.load(Main.class.getResource("FXMLDocument.fxml"));
scene.setRoot(root);
} catch (IOException ex) {
}
});
}).start();
}
public static void veryLongOperation() {
try {
// long-long operation
Thread.sleep(5000);
} catch (Exception ex) {
}
}
}
It should be simple but I can't set it working. My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<ws:consumer-config name="Web_Service_Consumer" wsdlLocation="http://procese/sysworkflow/en/classic/services/wsdl2" service="ProcessMakerService" port="ProcessMakerServiceSoap" serviceAddress="http://procese:80/sysworkflow/en/classic/services/soap2" doc:name="Web Service Consumer"/>
<data-mapper:config name="JSON_To_XML" transformationGraphPath="json_to_xml.grf" doc:name="JSON_To_XML"/>
<flow name="ws_pm_login3Flow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="#[{"userid":"xyz.qwe", "password":"12345"}]" doc:name="Set Payload"/>
<data-mapper:transform config-ref="JSON_To_XML" doc:name="JSON To XML"/>
<ws:consumer config-ref="Web_Service_Consumer" operation="login" doc:name="Web Service Consumer"/>
</flow>
</mule>
The WS is working fine.
The mapper file json_to_xml.grf looks like:
<?xml version="1.0" encoding="UTF-8"?><Graph __version="3.5.0" author="abc" created="Tue Apr 21 13:27:56 EEST 2015" description="JSON To XML" guiVersion="3.4.4.P" id="1429614596881" licenseCode="Unlicensed" licenseType="Unknown" modified="Tue Apr 21 13:27:56 EEST 2015" modifiedBy="abc" name="JSON_To_XML" revision="1.0" showComponentDetails="false">
<Global>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/login" _dataStructure="OBJECT" _id="__id" _type="Input" id="e941872a-c0e5-4148-ac8c-6010c4dad903">
<Record fieldDelimiter="," name="login" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="1" __sourcePath="{}/login/password" containerType="SINGLE" label="password" name="password" type="string"/>
<Field __index="0" __sourcePath="{}/login/userid" containerType="SINGLE" label="userid" name="userid" type="string"/>
</Record>
</Metadata>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/login" _dataStructure="OBJECT" _id="__id" _type="Output" id="d9e5b0f6-b757-46cb-89bf-a7662be5c77f">
<Record fieldDelimiter="," name="login" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="0" __sourcePath="{}/login/password" containerType="SINGLE" label="password" name="password" type="string"/>
<Field __index="1" __sourcePath="{}/login/userid" containerType="SINGLE" label="userid" name="userid" type="string"/>
</Record>
</Metadata>
<Dictionary>
<Entry id="DictionaryEntry0" input="true" name="inputPayload" output="false" type="object"/>
<Entry id="DictionaryEntry1" input="false" name="outputPayload" output="true" type="object"/>
</Dictionary>
</Global>
<Phase number="0">
<Node cacheInMemory="true" charset="UTF-8" enabled="enabled" fileURL="dict:outputPayload" guiName="XML WRITER" guiX="900" guiY="20" id="EXT_XML_WRITER0" type="EXT_XML_WRITER">
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<login xmlns:clover="http://www.cloveretl.com/ns/xmlmapping" clover:inPort="0">
<password>$0.password</password>
<userid>$0.userid</userid>
</login>]]></attr>
<attr name="_data_format"><![CDATA[XML]]></attr>
</Node>
<Node enabled="enabled" guiName="Foreach 'login' -> 'login'" guiX="460" guiY="20" id="FOREACH_LOGIN_LOGIN" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
<attr name="melScript"><![CDATA[//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
//END -> DO NOT REMOVE
output.password = input.password;
output.userid = input.userid;
]]></attr>
</Node>
<Node charset="UTF-8" enabled="enabled" fileURL="dict:inputPayload" guiName="JSON READER" guiX="20" guiY="20" id="JSON_READER0" type="JSON_READER">
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context xpath="/root">
<Context outPort="0" sequenceField="__id" xpath="object">
<Mapping cloverField="password" trim="true" xpath="password"/>
<Mapping cloverField="userid" trim="true" xpath="userid"/>
</Context>
</Context>
]]></attr>
<attr name="_data_format"><![CDATA[JSON]]></attr>
</Node>
<Edge debugMode="true" fromNode="FOREACH_LOGIN_LOGIN:0" guiBendpoints="" id="Edge1" inPort="Port 0 (in)" metadata="d9e5b0f6-b757-46cb-89bf-a7662be5c77f" outPort="Port 0 (out)" toNode="EXT_XML_WRITER0:0"/>
<Edge debugMode="true" fromNode="JSON_READER0:0" guiBendpoints="" id="Edge0" inPort="Port 0 (in)" metadata="e941872a-c0e5-4148-ac8c-6010c4dad903" outPort="Port 0 (out)" toNode="FOREACH_LOGIN_LOGIN:0"/>
</Phase>
</Graph>
When I start the process I get:
Error executing graph: ERROR (com.mulesoft.mule.module.datamapper.api.exception.DataMapperExecutionException). Message payload is of type: HashMap
I am using 3.6.1 EE
What am I missing?
Turns out it is a problem in mule to use the double quotes in JSON. I swithced to XML and now it is working fine.