Merge pull request #1238 from marcduiker/fix-java-workflow

Tutorials/Workflow: Sync Java implementation with .NET and Python
This commit is contained in:
Alice Gibbons 2025-08-29 12:17:45 +01:00 committed by GitHub
commit 16dac6e1db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View File

@ -31,10 +31,10 @@ public class SendNotificationActivity implements WorkflowActivity {
@Override
public Object run(WorkflowActivityContext ctx) {
Logger logger = LoggerFactory.getLogger(SendNotificationActivity.class);
var message = ctx.getInput(String.class);
var counter = ctx.getInput(Integer.class);
// Imagine a notification being sent to the user
logger.info("{} : Sending Notification: {}", ctx.getName(), message);
logger.info("{} : Sending Notification: {}", ctx.getName(), counter);
return true;
}
}

View File

@ -6,21 +6,17 @@
POST {{ apphost }}/start/{{counter}}
### Get the workflow status via the application
@instanceId={{startWorkflowRequest.response.body.instanceId}}
@instanceId={{startWorkflowRequest.response.body.*}}
GET {{ apphost }}/status/{{ instanceId }}
### Suspend the workflow
@instanceId={{startWorkflowRequest.response.body.instanceId}}
POST {{ apphost }}/suspend/{{ instanceId }}
### Resume the workflow
@instanceId={{startWorkflowRequest.response.body.instanceId}}
POST {{ apphost }}/resume/{{ instanceId }}
### Terminate the workflow
@instanceId={{startWorkflowRequest.response.body.instanceId}}
POST {{ apphost }}/terminate/{{ instanceId }}
### Purge the workflow
@instanceId={{startWorkflowRequest.response.body.instanceId}}
DELETE {{ apphost }}/purge/{{ instanceId }}