This commit is contained in:
Philipp 2020-05-27 18:25:22 +02:00
parent fc0ca9b000
commit 365796f023
7 changed files with 14 additions and 10 deletions

View file

@ -1,7 +1,7 @@
package com.bpmn.Rechnungseingang; package com.bpmn.Rechnungseingang;
import java.util.Date; import java.util.Date;
import java.util.concurrent.TimeUnit ;
import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate; import org.camunda.bpm.engine.delegate.JavaDelegate;
@ -12,10 +12,14 @@ public class BerechnungZahlungsziel implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception { public void execute(DelegateExecution execution) throws Exception {
Date zahlungsziel = (Date)execution.getVariable("FormField_date_Zahlungsziel"); Date zahlungsziel = (Date)execution.getVariable("FormField_date_Zahlungsziel");
Date aktuellesDatum = new Date(System.currentTimeMillis()); Date aktuellesDatum = new Date(System.currentTimeMillis());
System.out.println(zahlungsziel);
System.out.println(aktuellesDatum); long diffInMillies = Math.abs(zahlungsziel.getTime() - System.currentTimeMillis());
long diff = TimeUnit.HOURS.convert(diffInMillies, TimeUnit.MILLISECONDS);
System.out.println("Differenz: "+ diff);
execution.setVariable("FormField_bool_Zahlungsziel", true);
} }
} }

View file

@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Wed May 27 18:00:14 CEST 2020 #Wed May 27 18:21:29 CEST 2020
version=0.0.1-SNAPSHOT version=0.0.1-SNAPSHOT
groupId=com.bpmn groupId=com.bpmn
artifactId=Rechnungseingang artifactId=Rechnungseingang

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="2" failures="0" name="com.bpmn.Rechnungseingang.ProcessUnitTest" time="1.799" errors="0" skipped="0"> <testsuite tests="2" failures="0" name="com.bpmn.Rechnungseingang.ProcessUnitTest" time="1.831" errors="0" skipped="0">
<properties> <properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/> <property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jre1.8.0_251\bin"/> <property name="sun.boot.library.path" value="C:\Program Files\Java\jre1.8.0_251\bin"/>
@ -27,7 +27,7 @@
<property name="java.vm.specification.vendor" value="Oracle Corporation"/> <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/> <property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/> <property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\Users\Philipp\eclipse-workspace\.metadata\.plugins\org.eclipse.m2e.launching\launches\m2conf6407848476772294392.tmp"/> <property name="classworlds.conf" value="C:\Users\Philipp\eclipse-workspace\.metadata\.plugins\org.eclipse.m2e.launching\launches\m2conf5806348975243053779.tmp"/>
<property name="sun.jnu.encoding" value="Cp1252"/> <property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jre1.8.0_251\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_251/bin/server;C:/Program Files/Java/jre1.8.0_251/bin;C:/Program Files/Java/jre1.8.0_251/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\Philipp\AppData\Local\Microsoft\WindowsApps;C:\Users\Philipp\AppData\Local\GitHubDesktop\bin;C:\Windows\System32;;."/> <property name="java.library.path" value="C:\Program Files\Java\jre1.8.0_251\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_251/bin/server;C:/Program Files/Java/jre1.8.0_251/bin;C:/Program Files/Java/jre1.8.0_251/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\Philipp\AppData\Local\Microsoft\WindowsApps;C:\Users\Philipp\AppData\Local\GitHubDesktop\bin;C:\Windows\System32;;."/>
<property name="java.specification.name" value="Java Platform API Specification"/> <property name="java.specification.name" value="Java Platform API Specification"/>
@ -61,6 +61,6 @@
<property name="sun.desktop" value="windows"/> <property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/> <property name="sun.cpu.isalist" value="amd64"/>
</properties> </properties>
<testcase classname="com.bpmn.Rechnungseingang.ProcessUnitTest" name="testParsingAndDeployment" time="1.596"/> <testcase classname="com.bpmn.Rechnungseingang.ProcessUnitTest" name="testParsingAndDeployment" time="1.543"/>
<testcase classname="com.bpmn.Rechnungseingang.ProcessUnitTest" name="testHappyPath" time="0.203"/> <testcase classname="com.bpmn.Rechnungseingang.ProcessUnitTest" name="testHappyPath" time="0.288"/>
</testsuite> </testsuite>

View file

@ -1,4 +1,4 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Test set: com.bpmn.Rechnungseingang.ProcessUnitTest Test set: com.bpmn.Rechnungseingang.ProcessUnitTest
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.383 sec Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.756 sec