TheOpenCloudEngine / uEngine5-base

uEngine5 BPMS that totally re-written in Microservices architecture. uEngine5 can act as not only a conventional Workflow or BPMS but also as a REST api orchestrator or a BPaaS (Business process as a service) of members of OCE's MSA components.
MIT License
10 stars 13 forks source link

JPAWorkList need to get current date from database #3

Open jinyoung opened 7 years ago

jinyoung commented 7 years ago

Old implementation gets the current date from database not from the back end server. That means, some insert queries may be companied with native SQLs with current date, it may causes inconsistency with the date obtained by back-end and database server. But for new implementation will not use the native SQLs as possible, it may be ok. If it is problematic again, we need to implement this again:

Potential problematic implementations can be found at JPAWorkList or JPAProcessInstance

 Calendar dueDate = null;
            try{
                String dueDateInMSStr = ""+parameterMap.get(KeyedParameter.DUEDATE);
                long dueDateInMS = Long.parseLong(dueDateInMSStr);
                dueDate = Calendar.getInstance();
                dueDate.setTimeInMillis(dueDateInMS);
            }catch(Exception e){
            }

Old implementations obtains the date from the database like this SQL:

  select SYSDATE from dual