Category : activiti

Add a custom configuration to application.properties spring.activiti.customMybatisXMLMappers=com/codecraft/dao/ProcInstMapper.xml spring.activiti.customMybatisMappers=com.codecraft.dao.ProcInstMapper Use way public List<ProcInstVo> getAllProcInsts(){ return managementService.executeCustomSql(new AbstractCustomSqlExecution<ProcInstMapper,List<ProcInstVo>>(ProcInstMapper.class) { @Override public List<ProcInstVo> execute(ProcInstMapper procInstMapper) { return procInstMapper.selectAllProcInsts(); } }); } References spring-boot-sample-custom-myba..

Read more

event logger Event logger is an experimental function of activiti. Its purpose is to solve the problem that historical tables are inconvenient to query and analyze in relational databases. This feature can be used to graft activiti’s data to a big data platform for analysis. @Bean public CommandLineRunner init() { return new CommandLineRunner() { public ..

Read more

Introducing spring-data-elasticsearch <!– http://mvnrepository.com/artifact/org.springframework.data/spring-data-elasticsearch –> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-elasticsearch</artifactId> <version>2.0.1.RELEASE</version> </dependency> Custom event flusher public class EsEventFlusher extends AbstractEventFlusher { private static final Logger logger = LoggerFactory.getLogger(EsEventFlusher.class); @Override public void closing(CommandContext commandContext) { for (EventLoggerEventHandler eventHandler : eventHandlers) { try { EventLogEntryEntity entryEntity = eventHandler.generateEventLogEntry(commandContext); EventLogEs es = EventLogEs.buildFrom(entryEntity); EventLogEsRepository repository = ApplicationContextHolder.getContext().getBean(EventLogEsRepository.class); repository.save(es); logger.info(“###{}”,es); repository.refresh(); ..

Read more

Override initializeDefaultHandlers method public class EsEventLogger extends EventLogger{ private static final Logger logger = LoggerFactory.getLogger(EsEventLogger.class); public static final String EVENT_FLUSHER_KEY = “eventFlusher”; public EsEventLogger(Clock clock, ObjectMapper objectMapper) { super(clock, objectMapper); } @Override public void onEvent(ActivitiEvent event) { EventLoggerEventHandler eventHandler = getEventHandler(event); if (eventHandler != null) { // Events are flushed when command context is closed ..

Read more

Implement ProcessDiagramGenerator The main method is to extend the generateDiagram. public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor) { return generateDiagram(bpmnModel, imageType, highLightedActivities, highLightedFlows,null, null, null,null, scaleFactor); } By modifying this method, you can customize what color has been used and what color is currently used. Gets the current activity runtimeService.getActiveActivityIds(execution.getId()); ..

Read more