Skip to content

Instantly share code, notes, and snippets.

View talfco's full-sized avatar

Felix Kuestahler talfco

View GitHub Profile
package net.cloudburo.task.saga1;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
public class SaveOutputTask implements JavaDelegate {
package net.cloudburo.camel.saga1;
import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.RouteBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class Saga1ProcessRoutes extends RouteBuilder {
package net.cloudburo.app.controller;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
package net.cloudburo.app;
import org.flowable.idm.api.IdmIdentityService;
import org.flowable.idm.api.Privilege;
import org.flowable.idm.api.User;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
public class UserCreatorCommandLineRunner implements CommandLineRunner {
package net.cloudburo.app;
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.info.InfoEndpoint;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
package net.cloudburo.task.saga1;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import java.util.HashMap;
import java.util.Map;
public class InitVariablesTask implements JavaDelegate {
public void execute(DelegateExecution execution) {
def get_person_record(self, id):
recs = list(filter(lambda person: person['id'] == id, self._members))
if len(recs) != 1:
return None
else:
return recs[0]
def add_combinations_to_directory(self, comb_tuples, person_id, last_name):
for comb in comb_tuples:
if last_name in comb:
concat_name = self.generate_normalized_name(comb)
metaphone_tuple = doublemetaphone(concat_name)
if metaphone_tuple[0] in self.__lookup_dict[0]:
if not person_id in self.__lookup_dict[0][metaphone_tuple[0]]:
self.__lookup_dict[0][metaphone_tuple[0]].append(person_id)
else:
self.__lookup_dict[0][metaphone_tuple[0]] = [person_id]
def __calculate_name_matching(self, row):
name = row['Name']
name = (normalize_unicode_to_ascii(name)).strip()
tp = tuple(name.split(" "))
res = self.__gov_api.match_name(tp)
if res[0] is not None:
row['col_match1'] = res[0]
row['col_match2'] = str(res[1])
person = self.__gov_api.get_person_record(res[0])
row['party'] = person.get('party')