Repository navigation
Task/FOUR-34427: Create skill to optimize process and create an Alternative "B" of the process #9177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Task/FOUR-34427: Create skill to optimize process and create an Alternative "B" of the process #9177
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c85fd70
Add A/B alternative support to process MCP tools
agustinbusso 167e8c7
fix format
agustinbusso 8389a59
Merge branch 'feature/FOUR-34328' into task/FOUR-34427
agustinbusso 0aa9bf3
Prevent metadata updates from publishing draft BPMN
agustinbusso 004190e
Preserve drafts in process metadata updates
agustinbusso 29f6f72
Fix process alternative access and metadata updates
agustinbusso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
ProcessMaker/Mcp/Tools/Processes/EnableProcessAlternativeBTool.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace ProcessMaker\Mcp\Tools\Processes; | ||
|
|
||
| use Illuminate\Contracts\JsonSchema\JsonSchema; | ||
| use Laravel\Mcp\Request; | ||
| use Laravel\Mcp\Response; | ||
| use Laravel\Mcp\ResponseFactory; | ||
| use Laravel\Mcp\Server\Attributes\Description; | ||
| use Laravel\Mcp\Server\Attributes\Name; | ||
| use Laravel\Mcp\Server\Attributes\Title; | ||
| use ProcessMaker\Mcp\Processes\ProcessCatalog; | ||
|
|
||
| #[Name('enable-process-alternative-b')] | ||
| #[Title('Enable process Alternative B')] | ||
| #[Description('Creates Alternative B for a process by cloning the current Alternative A draft/published BPMN (package-ab-testing). Idempotent if B already exists.')] | ||
| class EnableProcessAlternativeBTool extends ProcessTool | ||
| { | ||
| public function handle(Request $request, ProcessCatalog $processes): Response|ResponseFactory | ||
| { | ||
| return $this->respond(function () use ($request, $processes): array { | ||
| $validated = $request->validate([ | ||
| 'id' => 'required|integer|min:1', | ||
| ]); | ||
|
|
||
| return $processes->enableAlternativeB( | ||
| $processes->actor($request->user()), | ||
| (int) $validated['id'], | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * @return array<string, \Illuminate\JsonSchema\Types\Type> | ||
| */ | ||
| public function schema(JsonSchema $schema): array | ||
| { | ||
| return [ | ||
| 'id' => ProcessFields::id($schema), | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.