This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ee:transform doc:name="pathToRead"> | |
<ee:message></ee:message> | |
<ee:variables> | |
<ee:set-variable variableName="readFilePath" ><![CDATA[%dw 2.0 | |
output text/plain | |
var webURLPatterns = '((\/ui\/?)+\$)|(\/ui\/messages)' | |
fun isWebRequest(requestedPath) = | |
sizeOf(requestedPath match(webURLPatterns)) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ee:transform doc:name="Transform Message"> | |
<ee:message > | |
<ee:set-payload ><![CDATA[%dw 2.0 | |
output application/json | |
--- | |
app.registry.defaultAnimal]]></ee:set-payload> | |
</ee:message> | |
</ee:transform> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="service-B-reply-listener-flow"> | |
<http:listener config-ref="HTTP_Listener_Configuration" path="/serviceBreply" doc:name="HTTP" /> | |
<logger message="Data is here guys!" level="INFO" doc:name="Logger" /> | |
<set-session-variable variableName="TransactionID" value="#[message.inboundProperties.TransactionID]" doc:name="Session Variable"/> | |
<vm:outbound-endpoint exchange-pattern="one-way" path="in-response" doc:name="VM in-response"/> | |
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<file:connector name="file-connector-config" autoDelete="false" streaming="true" | |
validateConnections="true" doc:name="File" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="startUpProcessFlow"> | |
<vm:inbound-endpoint exchange-pattern="request-response" path="/startup" doc:name="VM"/> | |
<flow-ref name="process-logicFlow" doc:name="process-logicFlow"/> | |
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="loadReportStatusFlow"> | |
<mulerequester:request config-ref="Mule_Requester" resource="file://src/main/resources/csv/month-status.csv" | |
doc:name="Mule Requester" metadata:id="93ffe5e0-53c8-4ad8-88e8-b0b2cd29ff2a"/> | |
<byte-array-to-string-transformer doc:name="Byte Array to String"/> | |
<custom-transformer class="com.ricston.invoiceintegration.transformer.StringToStatusRecordTransformer" doc:name="Java"/> | |
</flow> | |
<flow name="addNewMonthStatusRecordFlow"> | |
<set-payload value="#['\n' + server.dateTime.format("dd/MM/yyyy") ],#[flowVars.processStatus]" | |
mimeType="application/csv" doc:name="Set Payload"/> | |
<logger message="#[payload]" level="INFO" doc:name="Logger"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void scheduleOneDay(final MuleEventContext eventContext) { | |
String status=eventContext.getMessage().getInvocationProperty("processStatus"); | |
//runnable for logging and executing | |
final Runnable callFlow = createRunnableLauncher(eventContext); | |
//Schedule call in the next day | |
if(status.equals(InvoiceIntegrationUtils.STATUS_WAIT)){ | |
int delayInMinutes=InvoiceIntegrationUtils.addOneDayDelay(); | |
printNextSchedule(delayInMinutes); | |
scheduler.schedule(callFlow, delayInMinutes, TimeUnit.MINUTES); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SchedulerController implements Callable{ | |
private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); | |
private static final Logger logger = Logger.getLogger(SchedulerController.class); | |
@Override | |
public Object onCall(MuleEventContext eventContext) throws Exception { | |
scheduleOneDay(eventContext); | |
return eventContext.getMessage().getPayload(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="pollFirstOfMonthFlow"> | |
<poll doc:name="Poll"> | |
<schedulers:cron-scheduler expression="0 0 13 1 1/1 ? *"/> | |
<logger message="#[server.dateTime.getTime()] -- Poll: Initializaing invoice process" level="INFO" doc:name="Logger"/> | |
</poll> | |
<flow-ref name="process-logicFlow" doc:name="process-logicFlow"/> | |
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<spring:beans> | |
<spring:bean id="beanUtils" name="beanUtils" | |
class="com.ricston.invoiceintegration.schedule.util.InvoiceIntegrationUtils" | |
scope="singleton" /> | |
<spring:bean id="Bean" name="Bean" | |
class="com.ricston.invoiceintegration.schedule.FlowInvokerContextListener" | |
scope="singleton" /> | |
</spring:beans> |
NewerOlder