Skip to content

Commit

Permalink
Merge pull request #20 from hotwax/1_rule_groups
Browse files Browse the repository at this point in the history
Fixed: Corrected condition to upload csv file to ftp after successful execution of ATP rules (#1).
  • Loading branch information
dixitdeepak authored May 28, 2024
2 parents d54cde7 + de79a7d commit 922a680
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions service/co/hotwax/product/ProductFacilityServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,17 @@
<script>
kieSession.dispose();
</script>
<if condition="!productFacilityDetail.values()">

<!--If no products fall under any rule, no CSV will be created, and there will be no need to attempt to upload it to FTP.-->
<if condition="!csvFilePath">
<return message="No products falls under any rule in this rule group."/>
</if>

<service-call name="co.hotwax.product.ProductFacilityServices.upload#ProductFacilityCsvToFtp" transaction="force-new"
in-map="[filePath: csvFilePath, systemMessageRemoteId: systemMessageRemoteId]"
out-map="result"/>

<log message="Product facility rules executed successfully for rule group [${ruleGroupId}]."/>
<return message="Product facility rules executed successfully for rule group [${ruleGroupId}]."/>
</actions>
</service>
<service verb="prepare" noun="ProductFacilityCsv" authenticate="false" transaction-timeout="7200">
Expand Down
4 changes: 2 additions & 2 deletions service/co/hotwax/rule/DecisionRuleServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
in-map="[ruleGroupRunId:ruleGroupResult.ruleGroupRunId, ruleGroupRunResult:ruleGroupRunResult, hasError:hasError, endDate:ec.user.nowTimestamp]"
out-map="ruleGroupResult"/>

<message type="success">Finished rule group execution for ${ruleGroup.groupName} [${ruleGroupId}] rule group.</message>
<message type="success">Finished rule group execution for rule group [${ruleGroupId}].</message>
</actions>
</service>

Expand Down Expand Up @@ -196,7 +196,7 @@
<if condition="!paused">
<set field="paused" value="N"/>
</if>
<set field="jobName" value="Rule_Group_${ruleGroup.ruleGroupId}"/>
<set field="jobName" value="ATP_Rule_Group_${ruleGroup.ruleGroupId}"/>
<service-call name="create#moqui.service.job.ServiceJob" in-map="context + [jobName: jobName]" out-map="context"/>
<!-- Set the JobName in RuleGroup entity -->
<set field="ruleGroup.jobName" from="jobName"/>
Expand Down

0 comments on commit 922a680

Please sign in to comment.