mecdcme/is2

Error when clicking on relais

Closed this issue · 4 comments

https://github.com/mecdcme/is2/blob/master/db/is2-postgres.sql

you can find the last version of the database schema and metadata.
Check if the tables is2_gsbpm_process,is2_business_service ,is2_workset and is2_step_runtime are different with your version.
Maybe it's better if you save your data and recreate the database.
Did you also download the latest version of the code?

----- Messaggio originale -----
It looks like it is in the gsbpm table when finding parent process; parent colmn is in int8 tough so i don't understand still

Hibernate: select gsbpmproce0_.id as id1_14_0_, gsbpmproce0_.descr as descr2_14_0_, gsbpmproce0_.name as name3_14_0_, gsbpmproce0_.active as active4_14_0_, gsbpmproce0_.parent as parent6_14_0_, gsbpmproce0_.order_code as order_co5_14_0_, gsbpmproce1_.id as id1_14_1_, gsbpmproce1_.descr as descr2_14_1_, gsbpmproce1_.name as name3_14_1_, gsbpmproce1_.active as active4_14_1_, gsbpmproce1_.parent as parent6_14_1_, gsbpmproce1_.order_code as order_co5_14_1_ from is2_gsbpm_process gsbpmproce0_ left outer join is2_gsbpm_process gsbpmproce1_ on gsbpmproce0_.parent=gsbpmproce1_.id where gsbpmproce0_.id=?


I cannot see what is wrong; i tried to set all id with bigint type but no sucess;

Here is the error message :

org.springframework.dao.InvalidDataAccessApiUsageException: Provided id of the wrong type for class it.istat.is2.workflow.domain.BusinessService. Expected: class java.lang.Long, got class java.lang.Integer; nested exception is java.lang.IllegalArgumentException: Provided id of the wrong type for class it.istat.is2.workflow.domain.BusinessService. Expected: class java.lang.Long, got class java.lang.Integer

The two following methos look to be the culprits. Argument type must be "Long" and not "Integer".

public List findStepInstances(Long idBusinessService) {

    List<StepInstance> stepInstances = new ArrayList<>();

    BusinessService businessService = businessServiceDao.findById(idBusinessService).orElse(null);
    if (businessService != null) {
        List<AppService> appServiceList = appServiceDao.findByBusinessService(businessService);
        for (AppService appService : appServiceList) {
            stepInstances.addAll(stepInstanceDao.findByAppService(appService));
        }
    }

     return stepInstances;
}

public List<AppService> findAppServices(Long idBusinessService) {
    List<AppService> appServiceList = new ArrayList<>();
    BusinessService businessService = businessServiceDao.findById(idBusinessService).orElse(null);
    if (businessService != null) {
        appServiceList = appServiceDao.findByBusinessService(businessService);
    }
    return appServiceList;
}

Btw, I don't think it is a good choice to use Integer as there is some native method of spring for findId that you use in is2 and that use Long only parameter :

@repository
public interface BusinessServiceDao extends CrudRepository<BusinessService, Integer> {

// @OverRide
// List findAll();

Optional<BusinessService> findById(Long idService);

dear @Nolife999 we are doing some code refactoring :)