Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Whirlwind tour of Activiti 7 by Ryan Dawson

564 views

Published on

for more information visit : activiti.org

Published in: Software
  • Be the first to comment

Whirlwind tour of Activiti 7 by Ryan Dawson

  1. 1. Whirlwind Tour of Activiti 7 Ryan Dawson
  2. 2. Learn. Connect. Collaborate. Overview How to see what Activiti 7 offers? - Non-cloud/core examples - Cloud examples v7 offers a builder experience with less plumbing Examples and explanation in the gitbook We’ll point out differences from previous versions
  3. 3. Learn. Connect. Collaborate. How to use Core
  4. 4. Learn. Connect. Collaborate. Non-Cloud/Core Embedding an Activiti Engine into a single java runtime Key examples based around this process:
  5. 5. Learn. Connect. Collaborate. Project Structure
  6. 6. Learn. Connect. Collaborate. Security and Identity @Bean public UserDetailsService myUserDetailsService() { InMemoryUserDetailsManager inMemoryUserDetailsManager = new InMemoryUserDetailsManager(); String[][] usersGroupsAndRoles = { {"system", "password", "ROLE_ACTIVITI_USER"}, {"admin", "password", "ROLE_ACTIVITI_ADMIN"}, }; for (String[] user : usersGroupsAndRoles) { List<String> authoritiesStrings = Arrays.asList(Arrays.copyOfRange(user, 2, user.length)); logger.info("> Registering new user: " + user[0] + " with the following Authorities[" + authoritiesStrings + "]"); inMemoryUserDetailsManager.createUser(new User(user[0], passwordEncoder().encode(user[1]), authoritiesStrings.stream().map(s -> new SimpleGrantedAuthority(s)).collect(Collectors.toList()))); } return inMemoryUserDetailsManager; }
  7. 7. Learn. Connect. Collaborate. Process Text Connector @Bean public Connector processTextConnector() { return integrationContext -> { Map<String, Object> inBoundVariables = integrationContext.getInBoundVariables(); String contentToProcess = (String) inBoundVariables.get("content"); // Logic Here to decide if content is approved or not if (contentToProcess.contains("activiti")) { logger.info("> Approving content: " + contentToProcess); integrationContext.addOutBoundVariable("approved", true); } else { logger.info("> Discarding content: " + contentToProcess); integrationContext.addOutBoundVariable("approved", false); } return integrationContext; }; } <bpmn:serviceTask name="Process Text" implementation ="processTextConnector" >
  8. 8. Learn. Connect. Collaborate. How do we start processes? @Autowired private ProcessRuntime processRuntime; public void processText() { securityUtil.logInAs("system"); String content = pickRandomString(); ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder .start() .withProcessDefinitionKey("categorizeProcess") .withProcessInstanceName("Processing Content: " + content) .withVariable("content", content) .build()); }
  9. 9. Learn. Connect. Collaborate. Json Serialization public void processText() { securityUtil.logInAs("system"); Content content = pickRandomContent(); ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder .start() .withProcessDefinitionKey("categorizeProcess") .withProcessInstanceName("Processing Content: " + content) .withVariable("content", content) .build()); }
  10. 10. Non-Cloud Takeaways ● Embeddable as ever ● For spring the security and identity is plain spring ● New streamlined APIs for runtime interaction
  11. 11. Learn. Connect. Collaborate. Cloud Overview - Key Concepts: - Connectors - RB - Supporting services (query, audit, notifications, apps) - Getting Started - Demo - Testing - CI
  12. 12. Learn. Connect. Collaborate. What is Activiti Cloud?
  13. 13. Learn. Connect. Collaborate. Cloud Connectors
  14. 14. Learn. Connect. Collaborate. Which looks like... @StreamListener(value = ProcessingConnectorChannels.TWITTER_ANALYZER_CONSUMER) public void analyzeEnglishTweet(IntegrationRequest event) { String tweet = String.valueOf(event.getIntegrationContext().getInBoundVariables().get("text")); int sentiment = NLP.findSentiment(tweet); // … convert sentiment to attitude . // send attitude back as var Map<String, Object> results = new HashMap<>(); results.put("attitude", attitude); Message<IntegrationResult> message = IntegrationResultBuilder.resultFor(event, connectorProperties) .withOutboundVariables(results) .buildMessage(); integrationResultSender.send(message); }
  15. 15. Learn. Connect. Collaborate. Runtime Bundle as executor
  16. 16. Learn. Connect. Collaborate. Structure of an RB
  17. 17. Learn. Connect. Collaborate. OOTB Cloud Components
  18. 18. Learn. Connect. Collaborate. Trending Topics
  19. 19. Learn. Connect. Collaborate. Helm Chart
  20. 20. Learn. Connect. Collaborate. Acc Tests
  21. 21. Learn. Connect. Collaborate. UI
  22. 22. Learn. Connect. Collaborate. REST API and Java API - processRuntime and taskRuntime methods map directly to REST endpoints - Parameter and return types in Java API map to REST json objects - Acceptance tests use this to write clean test code - Enables natural transition from non-cloud to cloud
  23. 23. Learn. Connect. Collaborate. Query and Audit
  24. 24. Learn. Connect. Collaborate. Other Examples! - Try it out! - Gitbook - gitter
  25. 25. Learn. Connect. Collaborate. The future is bright! - FaaS/knative - Istio integration - Spring Cloud next gen - JHipster integration - GraalVM - Activiti cloud operator
  26. 26. Thanks!

×