zef-dev/convoworks-pckg-forms
Composer 安装命令:
composer require zef-dev/convoworks-pckg-forms
包简介
Contains conversational workflow elements for managing forms in the Convoworks framework.
关键字:
README 文档
README
This package contains conversational workflow elements for managing form entries scenarios in the Convoworks framework. It contains elements that you can use in the conversation workflow, but the form data source is just described via the IFormsContext interface.
When we are talking about workflow components (elements), we have to primarily consider voice and conversational design needs. Their properties, sub-flows and general behavior are tailored to make conversational workflow as easy as possible. They are not related to any particular forms plugin or a similar 3rd party service provider.
Form context is on the other hand a bridge between workflow elements (Convoworks) and the real, concrete form plugin you are using in your system.
Forms package favors field keys over numeric ids. When you are creating or updating entries, use field keys to define data. When you are loading entries, they will contain a meta_values field, an associative array containing field key / field value pairs.
Forms context interface
IFormsContext describes methods that should be implemented by a target form system. If you have e.g. WordPress Formidable Forms plugin, you can easily enable it to be used with Convoworks by implementing this interface.
To be properly used in the Convoworks GUI, it also has to implement IBasicServiceComponent and IServiceContext. You might consider to start your implementation like this:
class MyCustomFormsContext extends AbstractBasicComponent implements IFormsContext, IServiceContext { }
You can check for more about developing custom packages on the Convoworks documentation and you can check our Convoworks WP Plugin Package Template
DummyFormContext
Dummy implementation that can serve to test voice applications or as an example when creating your own IFormsContext implementation.
Here are few predefined features that it has:
- it will store entries in the Convoworks user scope
- required fields (for error handling)
Workflow elements
All forms package workflow elements have the context_id property which hooks them to the context which implements the IFormsContext interface. That way elements are concentrated on the conversation workflow needs, while the real business logic is delegated to the concrete implementation.
Here are all common parameters:
context_id- Id of the referenced form context (context component that implementsIFormsContext)result_var- Variable that contains result. It is different for each element, so it will be described below.
Some elements have multiple sub-flows depending on the result we got. This kind of approach enables you to use less IF statements in your workflow. But in order not to force you to split workflow, some of the flows are optional and when left empty, the default flow will be executed.
CreateEntryElement
This element will create an entry and will return newly created entry_id.
Parameters:
entry- The entry data that will be written (a key value)result_var- Defaultstatus, name of the variable that contains additional information. If entry is created (entry_id: ID of the newly created entry), if failed (message: string message,errors: array of detailed errors)
Flows:
ok- executes when the entry could be createdvalidation_error- executes when the entry has validation errors
UpdateEntryElement
Element which updates existing entry data.
Parameters:
entry_id- ID of the existing entryentry- The entry data that will overwrite the previous data (a key value)result_var- Defaultstatus, name of the variable that contains additional information. If entry is updated (previous: entry data before update,updated: entry after update), if failed (message: string message,errors: array of detailed errors)
Flows:
ok- will be executed when the entry is updatedvalidation_error- executes when the entry has validation errors
DeleteEntryElement
This element will delete an existing entry.
Parameters:
entry_id- ID of the existing entryresult_var- Defaultstatus, name of the variable that contains additional information (previous: previous form entry as you would get it with load entry element)
Flows:
ok- will be executed when the entry is deleted
LoadEntryElement
This element will load an existing entry by its id.
Parameters:
entry_id- ID of the existing entryresult_var- Defaultstatus, name of the variable that contains additional information (entry)
Flows:
ok- will be executed when the entry is loaded
Single entry representation as JSON.
{
"entry_id" : "123",
"user_id" : "123",
"meta_values" : {
"key_1" : "value 1",
"key_2" : "value 2"
}
}
SearchEntryElement
This element searches entries by the given search parameter.
Parameters:
search- Search filter. Defined by a referenced form context.offset- Offsetlimit- Limitorder_by- key/val pairs of field name (defined by form context implementation) and sort order (ASC|DESC)result_var- Defaultstatus, name of the variable that contains additional information (result: array of entry values)
Flows:
ok- Executed when the form is loaded.not found- will be executed if no entry was found
For more information, please check out convoworks.com
zef-dev/convoworks-pckg-forms 适用场景与选型建议
zef-dev/convoworks-pckg-forms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 65 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 05 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「convoworks」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zef-dev/convoworks-pckg-forms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zef-dev/convoworks-pckg-forms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zef-dev/convoworks-pckg-forms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Guzzle http client implementation for Convoworks
Experimental mysqli component package for the Convoworks
Specialized Convoworks components for handling trivia quiz services
Convoworks components for reading files from the filesystem
Filesystem service data layer implementation for the Convoworks
Tribes Ascend components package for Convoworks
统计信息
- 总下载量: 65
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-26