Skip to content
Snippets Groups Projects
Commit 3ce68ef5 authored by David Büchler's avatar David Büchler
Browse files

Neues Entity für Charts für KampagnenManagement

parent 7d5c46cd
No related branches found
No related tags found
No related merge requests found
Showing
with 177 additions and 0 deletions
......@@ -17,6 +17,14 @@
<state>AUTO</state>
<valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaign_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaign_id/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValidation.js</onValidation>
<onValueChange>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
<element>PROCESS_SETVALUE</element>
<element>RECORD</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>CAMPAIGNSTEP_ID</name>
......@@ -26,6 +34,7 @@
<state>EDITABLE</state>
<valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>campaignParticipantMessage</name>
......@@ -81,6 +90,27 @@
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityConsumer>
<name>CampaignAnalyses</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>CampaignAnalysis_entity</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
<children>
<entityParameter>
<name>campaignParticipants_param</name>
<valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignanalyses/children/campaignparticipants_param/valueProcess.js</valueProcess>
<triggerRecalculation v="true" />
</entityParameter>
<entityParameter>
<name>campaignStepId_param</name>
<valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignanalyses/children/campaignstepid_param/valueProcess.js</valueProcess>
<triggerRecalculation v="true" />
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.vars");
import("system.result");
result.string(vars.get("$param.campaignParticipants_param"));
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.result");
logging.log("hui: " + vars.get("$field.CAMPAIGNSTEP_ID"));
result.string(vars.get("$field.CAMPAIGNSTEP_ID"));
\ No newline at end of file
import("system.neon");
neon.refreshAll();
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.1">
<name>CampaignAnalysis_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
<dependencies>
<entityDependency>
<name>afaa52b1-6e5b-46be-adef-e50f1394fcf8</name>
<entityName>CampaignAddParticipants_entity</entityName>
<fieldName>CampaignAnalyses</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityField>
<name>UID</name>
</entityField>
<entityField>
<name>LABEL</name>
</entityField>
<entityField>
<name>COUNT</name>
</entityField>
<entityField>
<name>SORTING</name>
</entityField>
<entityProvider>
<name>CampaignAnalysisProvider</name>
<fieldType>DEPENDENCY_IN</fieldType>
<children>
<entityParameter>
<name>campaignParticipants_param</name>
<triggerRecalculation v="true" />
</entityParameter>
<entityParameter>
<name>campaignStepId_param</name>
<triggerRecalculation v="true" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>campaignStepId_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>campaignParticipants_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/CampaignAnalysis_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<recordFields>
<element>UID.value</element>
<element>LABEL.value</element>
<element>COUNT.value</element>
<element>SORTING.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.logging");
import("system.result");
import("system.util");
import("system.db");
logging.log(" -> etz warad i im condition....");
var ret = [];
var campaignstepid = vars.get("$param.campaignStepId_param");
var newParticipants = vars.get("$param.campaignParticipants_param");
var query = "select MAXPARTICIPANTS, count(CAMPAIGNPARTICIPANTID) from CAMPAIGNSTEP "
+ "join CAMPAIGNPARTICIPANT on CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID = CAMPAIGNSTEP.CAMPAIGNSTEPID "
+ "where CAMPAIGNSTEP_ID = '" + campaignstepid + "'"
+ "group by CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID, MAXPARTICIPANTS";
var maxCurrentParticipants = db.table(query);
if(maxCurrentParticipants.length > 0)
{
logging.log("hallo2");
ret[0] = [util.getNewUUID(), "Current Participants", maxCurrentParticipants[0][1], 0];
ret[1] = [util.getNewUUID(), "New Participants", newParticipants, 0];
ret[2] = [util.getNewUUID(), "Max Participants", Number(maxCurrentParticipants[0][0]) - (Number(maxCurrentParticipants[0][1] + Number(newParticipants))), 2];
}
result.object(ret);
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0">
<name>CampaignAnalysis</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<entity>CampaignAnalysis_entity</entity>
<references>
<neonViewReference>
<name>ebb2a4e0-5e0e-4749-8ed8-7aa3b8cae3fc</name>
<view>CampaignStepCurrentMaxParticipants_view</view>
</neonViewReference>
</references>
</neonContext>
......@@ -27,5 +27,10 @@
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
<name>cbae33c2-7eec-47ab-810e-9ac59b1ec575</name>
<entityField>CampaignAnalyses</entityField>
<view>CampaignStepCurrentMaxParticipants_view</view>
</neonViewReference>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>CampaignStepCurrentMaxParticipants_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<singleDataChartViewTemplate>
<name>CurrentToMaxParticipantsChart</name>
<chartType>PIE</chartType>
<xAxis>LABEL</xAxis>
<yAxis>COUNT</yAxis>
<entityField>#ENTITY</entityField>
</singleDataChartViewTemplate>
</children>
</neonView>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment