[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACQ73MG22S54YP54Q911RQ":3,"skill-same:01M6ACQ73MG22S54YP54Q911RQ":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":7,"updatedAt":43,"install":44,"resources":57},"01M6ACQ73MG22S54YP54Q911RQ","manage-service-groups","OFBiz 服务组管理",null,"","apache\u002Fofbiz-plugins","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACMJJ1Q4WYATY4GXZ2FAVD",178,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-service-groups\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",[30],"manage service groups","2026-11-10 10:12:30",false,"\u003C!--\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\nhttp:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n-->\n\n---\nname: manage-service-groups\ndescription: Orchestrate multiple services using the OFBiz Group Engine for sequential or concurrent execution.\n---\n\n# Manage Service Groups\n\nService Groups allow you to define a single service that acts as a wrapper for multiple child services. This is ideal for orchestrating complex workflows where several independent services need to run together. (**Cross-Reference**: See the [manage-services](..\u002Fmanage-services\u002FSKILL.md) skill for the foundational rules on service implementation).\n\n## Triggers\n- Executing multiple services in a specific sequence.\n- Running services concurrently to improve performance.\n- Wrapping multiple operations in a single transactional unit.\n- Scaffolding complex integration flows (e.g., \"Complete Purchase Order\" which might involve receiving items, creating invoices, and posting to GL).\n\n## Procedures\n\n### 1. Engine vs Workflow Definitions\n- **Group Engine (`engine=\"group\"`)**: Use exclusively for straight-line sequential or concurrent fire-and-forget flows that do not have complex conditional branching or data dependencies between steps.\n- **Groovy Engine (`engine=\"groovy\"`)**: Use if your workflow requires conditional `if\u002Felse` logic, try\u002Fcatch error handling, complex iteration, or complex data transformations between service steps.\n\n### 2. Define the Group Service (`services.xml`)\nIn your `services.xml`, define a service using `engine=\"group\"`. Ensure you include the `invoke` and `use-transaction` attributes. (**Cross-Reference**: See the [manage-services](..\u002Fmanage-services\u002FSKILL.md) skill for comprehensive rules on service definitions, authentication, and REST exports.)\n\n```xml\n\u003Cservice name=\"myServiceGroup\" engine=\"group\" auth=\"true\">\n    \u003Cdescription>Orchestrates multiple services\u003C\u002Fdescription>\n    \u003Cattribute name=\"orderId\" mode=\"IN\" type=\"String\"\u002F>\n\u003C\u002Fservice>\n```\n\n### 3. Define the Group Members\nCreate a `groups.xml` (or similar) file to define which services belong to the group. (**Cross-Reference**: Ensure each individual member service is defined according to the rules in [manage-services](..\u002Fmanage-services\u002FSKILL.md)).\n\n- **Location**: Typically `servicedef\u002Fgroups.xml`.\n- **Registration**: Register in `ofbiz-component.xml`:\n  ```xml\n  \u003Cservice-resource type=\"group\" loader=\"main\" location=\"servicedef\u002Fgroups.xml\"\u002F>\n  ```\n\n#### Group Definition Pattern\n```xml\n\u003Cservice-group name=\"myServiceGroup\">\n    \u003Cinvoke name=\"firstService\" mode=\"sync\"\u002F>\n    \u003Cinvoke name=\"secondService\" mode=\"async\" pause=\"1000\"\u002F>\n    \u003Cinvoke name=\"thirdService\" mode=\"sync\" optional=\"true\"\u002F>\n\u003C\u002Fservice-group>\n```\n\n**Attributes for `\u003Cinvoke>`**:\n- `name`: The service to call.\n- `mode`: `sync` (sequential) or `async` (parallel\u002Fbackground).\n- `optional`: If `true`, the group continues even if this service fails.\n- `result-to-context`: If `true`, the results of this service are added to the context for subsequent services in the group.\n\n## Guardrails\n- **Transaction Behavior**: By default, a group service runs in a single transaction. If a `sync` member fails and isn't `optional=\"true\"`, the entire transaction rolls back. (**Cross-Reference**: See the [manage-services](..\u002Fmanage-services\u002FSKILL.md) skill for deep-dives into `use-transaction` versus `require-new-transaction` mapping).\n- **Context collisions**: Context passing only happens when `result-to-context=\"true\"` for `sync` steps. Context collisions are a risk here; encourage prefixing output keys or mapping results in wrapper services.\n- **Async Pitfalls**: If you use `mode=\"async\"` within a group, that service runs in its own thread\u002Ftransaction. The group won't wait for it to finish unless specifically architected otherwise.\n- **Service Engine**: Use `engine=\"group\"` only for orchestration. Don't put business logic in the group definition itself.\n\n## Anti-Patterns\n\n### Anti-Pattern 1: Hidden Branching Logic\n**Bad:** Using `optional=\"true\"` to simulate an `if\u002Felse` block.\n```xml\n\u003Cgroup name=\"processPayment\" send-mode=\"all\">\n    \u003Cinvoke name=\"chargeStripe\" mode=\"sync\" optional=\"true\"\u002F>\n    \u003Cinvoke name=\"logPaymentSuccess\" mode=\"sync\"\u002F>\n\u003C\u002Fgroup>\n```\n\n**Good:** Using a Groovy orchestrator service for real conditional logic. (**Cross-Reference**: See the [manage-groovy](..\u002Fmanage-groovy\u002FSKILL.md) skill)\n```groovy\ndef stripeResult = run service: \"chargeStripe\", with: context\nif (ServiceUtil.isError(stripeResult)) {\n    logWarning(\"Stripe failed, trying alternative...\")\n} else {\n    run service: \"logPaymentSuccess\", with: context\n}\n```\n\n### Anti-Pattern 2: The `result-to-context` Trap\n**Bad:** Overwriting generic context variables (e.g., `statusId`) across multiple services.\n```xml\n\u003Cgroup name=\"createOrderAndInvoice\" send-mode=\"all\">\n    \u003Cinvoke name=\"createOrder\" mode=\"sync\" result-to-context=\"true\"\u002F>\n    \u003Cinvoke name=\"createInvoice\" mode=\"sync\" result-to-context=\"true\"\u002F>\n\u003C\u002Fgroup>\n```\n\n**Good:** Explicitly mapping values in a Groovy service instead of blindly sharing context.\n```groovy\ndef orderMap = run service: \"createOrder\", with: orderCtx\ndef invoiceCtx = [orderId: orderMap.orderId, partyId: context.partyId]\ndef invoiceMap = run service: \"createInvoice\", with: invoiceCtx\n```\n\n### Anti-Pattern 3: Async Race Conditions\n**Bad:** Expecting a `sync` step 2 to wait for an `async` step 1.\n```xml\n\u003Cgroup name=\"reportFlow\" send-mode=\"all\">\n    \u003Cinvoke name=\"generateReport\" mode=\"async\"\u002F>\n    \u003Cinvoke name=\"emailReport\" mode=\"sync\"\u002F>\n\u003C\u002Fgroup>\n```\n\n**Good:** Run both as `sync` in a fire-and-forget orchestrator, OR use a SECA on `generateReport` success. (**Cross-Reference**: See the [manage-eca](..\u002Fmanage-eca\u002FSKILL.md) skill)\n\n### Anti-Pattern 4: Thread Exhaustion with `pause`\n**Bad:** Putting the Tomcat web thread to sleep using `pause`.\n```xml\n\u003Cgroup name=\"waitAndRetry\" send-mode=\"all\">\n    \u003Cinvoke name=\"waitForExternalSystem\" mode=\"sync\" pause=\"5000\"\u002F>\n\u003C\u002Fgroup>\n```\n\n**Good:** Use explicit asynchronous scheduled jobs instead of pausing the current thread. (**Cross-Reference**: See the [manage-quartz-jobs](..\u002Fmanage-quartz-jobs\u002FSKILL.md) skill)\n\n### Anti-Pattern 5: Distributed Transaction Failures\n**Bad:** Mixing local database commits with external ERP REST calls where compensation is impossible.\n```xml\n\u003Cgroup name=\"fulfillOrder\" send-mode=\"all\">\n    \u003Cinvoke name=\"updateInventoryDB\" mode=\"sync\"\u002F>\n    \u003Cinvoke name=\"notifyERP\" mode=\"sync\"\u002F>\n\u003C\u002Fgroup>\n```\n\n**Good:** Avoid doing this in Service Groups. Use manual Groovy transaction catch blocks or `global-rollback` SECAs.\n\n### Anti-Pattern 6: Output Parameter Masking\n**Bad:** Relying on Service Groups to blindly gather context and assuming the caller gets specific `OUT` parameters back correctly.\n\n**Good:** Use a Groovy wrapper service to explicitly construct and return results.\n\n## Examples\n\n### Sequential Purchase Order Completion\n```xml\n\u003Cservice-group name=\"completePurchaseOrder\">\n    \u003Cinvoke name=\"receiveInventory\" mode=\"sync\"\u002F>\n    \u003Cinvoke name=\"createPurchaseInvoice\" mode=\"sync\"\u002F>\n    \u003Cinvoke name=\"postToGeneralLedger\" mode=\"sync\" optional=\"true\"\u002F>\n\u003C\u002Fservice-group>\n```\n\n### Concurrent Notifications\n```xml\n\u003Cservice-group name=\"sendMassNotifications\">\n    \u003Cinvoke name=\"sendEmailNotification\" mode=\"async\"\u002F>\n    \u003Cinvoke name=\"sendSMSNotification\" mode=\"async\"\u002F>\n    \u003Cinvoke name=\"logNotificationStats\" mode=\"sync\"\u002F>\n\u003C\u002Fservice-group>\n```\n",{},"trunk","6c6c27710443de03e9247605d33a2e2f5bc3d1e2","ai-agent-skills\u002Fmanage-service-groups",222,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins","https:\u002F\u002Fofbiz.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-12 22:04:06",{"source":9,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add apache\u002Fofbiz-plugins --skill manage-service-groups",{"tool":50,"command":51},"bunx","bunx skills add apache\u002Fofbiz-plugins --skill manage-service-groups",{"tool":53,"command":54},"pnpm","pnpm dlx skills add apache\u002Fofbiz-plugins --skill manage-service-groups","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-service-groups\u002FSKILL.md",true,[],[59,71,83,97,111,125],{"skillNo":60,"name":61,"nameZh":62,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":63,"categories":64,"keywords":69,"publishedAt":31},"01M6ACQSN90YKJZ92MQ52D9R8H","prepush-readiness","推送前就绪检查","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fprepush-readiness\u002FSKILL.md",[65,66],{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},{"categoryNo":67,"categoryName":68,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[70],"prepush readiness",{"skillNo":72,"name":73,"nameZh":74,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":75,"categories":76,"keywords":81,"publishedAt":31},"01M6ACQPR1WRA751V4DXVC3AHF","manage-webapps","Web 应用管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-webapps\u002FSKILL.md",[77,78],{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},{"categoryNo":79,"categoryName":80,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BWKS60NTYJHFE9FQSXGDKS","低代码应用开发",[82],"manage webapps",{"skillNo":84,"name":85,"nameZh":86,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":87,"categories":88,"keywords":95,"publishedAt":31},"01M6ACQMCX8Z7NY2CE08NCV6ND","manage-themes","主题管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-themes\u002FSKILL.md",[89,92],{"categoryNo":90,"categoryName":91,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TQMKHSMFVQHR2KYAEVN","界面设计师",{"categoryNo":93,"categoryName":94,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[96],"manage themes",{"skillNo":98,"name":99,"nameZh":100,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":101,"categories":102,"keywords":109,"publishedAt":31},"01M6ACQHYN20AFWF6TKK4RGQ8A","manage-tests","测试管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-tests\u002FSKILL.md",[103,106],{"categoryNo":104,"categoryName":105,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":107,"categoryName":108,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[110],"manage tests",{"skillNo":112,"name":113,"nameZh":114,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":115,"categories":116,"keywords":123,"publishedAt":31},"01M6ACQFRMW7R45YD3HRAXPGWF","manage-templates","模板管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-templates\u002FSKILL.md",[117,120],{"categoryNo":118,"categoryName":119,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TK1MPB82068236GSXDE","文档处理",{"categoryNo":121,"categoryName":122,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TPH3VQWKQZXV7EPF8VZ","办公行政人员",[124],"manage templates",{"skillNo":126,"name":127,"nameZh":128,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":129,"categories":130,"keywords":137,"publishedAt":31},"01M6ACQCSSDZQMD8VX2K3WRR93","manage-strategies","策略管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-strategies\u002FSKILL.md",[131,134],{"categoryNo":132,"categoryName":133,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BTXF8K9DFQC4T4TXVH0NMZ","策略与托管设置管理",{"categoryNo":135,"categoryName":136,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8C6RQ852C9AEJFCBGG1YA7S","IT 管理员",[138],"manage strategies"]