Commit e4e5cc0f authored by Marta Różańska's avatar Marta Różańska
Browse files

changes in Mule with support designatedSolver variable

parent f4f1ce81
......@@ -534,16 +534,17 @@ http://www.mulesoft.org/schema/mule/imap http://www.mulesoft.org/schema/mule/ima
<logger message="#[&quot;URI: &quot; + message.inboundProperties.'http.request.uri' + &quot;\nBODY: &quot; + message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
</sub-flow>
<flow name="constraintProblemSolution_POST_CPSolver">
<set-variable variableName="designatedSolver" value="#[json:designatedSolver]" doc:name="DesignatedSolver Variable"/>
<logger message="designatedSolver: #[flowVars.designatedSolver]" level="INFO" doc:name="Logger"/>
<jackson2:from-json config-ref="ToSolutionRequestImpl" doc:name="JSON to eu.melodic.models.services.process.SolutionRequestImpl"/>
<set-property propertyName="use-external-optimizer" value="${cp_solver.useUtilityGenerator}" encoding="ISO-8859-6" doc:name="Property" />
<auto-transformer doc:name="Transform to eu.melodic.models.interfaces.cpSolver.ConstraintProblemSolutionRequestImpl" returnClass="eu.melodic.models.interfaces.cpSolver.ConstraintProblemSolutionRequestImpl" />
<jackson2:write-value-as-string config-ref="ToConstraintProblemRequestImpl" doc:name="To JSON"/>
<set-property propertyName="Content-Type" value="application/json" doc:name="set Content-Type to application/json"/>
<set-property propertyName="authorization" value="#[message.inboundProperties.authorization]" doc:name="Set authorization token"/>
<set-variable variableName="designatedSolver" value="#[json:designatedSolver]" doc:name="DesignatedSolver Variable"/>
<logger message="Sending request to CP Solver: #[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
<choice doc:name="Copy_of_Choice">
<when expression="flowVars.designatedSolver == ptsolver">
<choice doc:name="Choice">
<when expression="#['PTSOLVER'.equals(flowVars.designatedSolver)]">
<logger message="Sending request to PT Solver: #[message.payloadAs(java.lang.String)]" level="INFO" doc:name="PTSolver - Logger"/>
<until-successful maxRetries="${eai.http.failover.nb_of_retries}" millisBetweenRetries="${eai.http.failover.timeout}" synchronous="true" doc:name="Copy_of_Until Successful">
<processor-chain doc:name="Copy_of_Processor Chain">
<http:request config-ref="PT_Solver_HTTP_Request_Configuration" path="/constraintProblemSolution" method="POST" doc:name="PtSolver">
......@@ -551,10 +552,11 @@ http://www.mulesoft.org/schema/mule/imap http://www.mulesoft.org/schema/mule/ima
</http:request>
</processor-chain>
</until-successful>
<set-property propertyName="http.status" value="#[message.inboundProperties.'http.status']" doc:name="Copy_of_Copy_of_Set Http status"/>
<flow-ref name="LogPayload" doc:name="Copy_of_LogPayload"/>
<set-property propertyName="http.status" value="#[message.inboundProperties.'http.status']" doc:name="Set Http status"/>
<flow-ref name="LogPayload" doc:name="LogPayload"/>
</when>
<otherwise>
<logger message="Sending request to CP Solver: #[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
<until-successful maxRetries="${eai.http.failover.nb_of_retries}" millisBetweenRetries="${eai.http.failover.timeout}" synchronous="true" doc:name="Until Successful">
<processor-chain doc:name="Processor Chain">
<http:request config-ref="CPSolver_HTTP_Request_Configuration" path="/constraintProblemSolution" method="POST" doc:name="CPSolver">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment