Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berndruecker/dbc22c3bb92719be40d41bc9cbbb88d6 to your computer and use it in GitHub Desktop.
Save berndruecker/dbc22c3bb92719be40d41bc9cbbb88d6 to your computer and use it in GitHub Desktop.
@Component
public class CreateCustomerInCrmJavaDelegate implements JavaDelegate {
@Autowired
private ObjectMapper objectMapper;
@Autowired
private CrmFacade crmFacade;
public void execute(DelegateExecution execution) throws Exception {
// Data Input Mapping
String customerDataJson = (String) execution.getVariable("customerData");
CustomerData customerData = objectMapper.readValue(customerDataJson, CustomerData.class);
// Delegate to business logic
String customerId = crmFacade.createCustomer(customerData);
// Data Output Mapping
execution.setVariable("customerId", customerId);
}
}
@berndruecker
Copy link
Author

I would not try to fit in too much in one go. If they have the code above - that would at least still work if "adapted" - which would be my main point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment