Awesome
iwf-java-samples
Samples for iWF Java SDK that runs against iWF server.
We also have smaller code snippets (also known as mini demos) that demonstrate how to utilize iWF to perform a minimum funcion.
Setup
- Start a iWF server following the instructions
- Run this project by using gradle task
bootRun
.
_Note that by default this project will listen on 8803 port
Product Use case samples
Money transfer workflow/SAGA Patten
This example shows how to transfer money from one account to another account. The transfer involves multiple steps. When any step fails, the whole transfer is canceled with some compensation steps.
User sign-up/registry workflow
A common use case that is almost everywhere -- new user sign-up/register a new account in a website/system. E.g. Amazon/Linkedin/Google/etc...
Microservice ochestration
This is the code that is shown in iWF server as an example of microservice orchestration.
JobSeeker Engagement workflow
<img width="709" alt="Screenshot 2023-04-21 at 8 53 25 AM" src="https://user-images.githubusercontent.com/4523955/233680837-6a6267a0-4b31-419e-87f0-667bb48582d1.png">See Engagement for how to build an jobSeeker engagement workflow.
- An engagement is initiated by an employer to reach out to a jobSeeker(via email/SMS/etc)
- The jobSeeker could respond with decline or accept
- If jobSeeker doesn't respond, it will get reminder
- An engagement can change from declined to accepted, but cannot change from accepted to declined
Job Post System (a mini Indeed.com)
See JobPost for how to build an JobPost system like Indeed.com
Support typical CRUD operations:
- Create a job with tile, description and notes
- Read a job
- Update a job
- Delete a job
And also
- Search for jobs using full-text search
- Update will trigger a background action to update external system with eventual consistency
Subscription workflow
See Subscription with unit tests for the use case also described in:
In additional, iWF provides "Auto-ContinueAsNew feature to allow running the workflow infinitely
Shortlist Candidates workflow
<img width="709" alt="Candidate Shortlisting Use Case" src="src/main/java/io/iworkflow/workflow/shortlistcandidates/use_case.png">See ShortlistCandidates for how to build a workflow to automatically establish connections with shortlisted candidates on behalf of an employer.
- Design a workflow as long-term storage: leveraging the attributes of iWF to retain the employer opt-in information in EmployerOptInWorkflow.
- Retrieve the attributes of another workflow from within a different workflow: checking the employer's opt-in status stored in the EmployerOptInWorkflow when making a decision on whether to automatically contact shortlisted candidates for that employer in the ShortlistWorkflow.