Hi,
I'm trying to add an additional service action for use within a workflow according to https://www.espocrm.com/documentatio...rvice-actions/.
As described, I added an additional service class by copying the sample code and put it into ../custom/Espo/Custom/Services/TestService.php:
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class TestService extends \Espo\Core\Services\Base
{
public function testServiceAction($workflowId, Entity $entity, $additionalParameters = null)
{
//your code here
}
}
Next I added the json-File .../Resources/metadata/entityDefs/Workflow.json actually again by simply copying the sample data:
{
"serviceActions": {
"Call": {
"testServiceAction": {
"serviceName": "TestService",
"methodName": "testServiceAction"
}
}
}
}
Last, the labdel assignment in .../Resources/i18n/en_US/Workflow.json and .../Resources/i18n/de_DE/Workflow.json:
{
"serviceActions": {
"testServiceAction": "Label for TestServiceAction"
}
}
Unfortunately, nothing happens after restarting or clearing the cache and I'm really a bit lost now.
I set the logging level to debug, but in the log files are only entries that seem unrelated to my problem, but belong to the automated email sending I've set up also.
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\ActionManager: Start workflow rule ID [5ae7759a3088f4076]. [] []
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\Actions: Start [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\Actions: End [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\ActionManager: End workflow rule ID [5ae7759a3088f4076]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\ActionManager: Start workflow rule ID [5ae7759a3088f4076]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\Actions: Start [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\Actions: End [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\ActionManager: End workflow rule ID [5ae7759a3088f4076]. [] []
I guess the service class has been recognized properly as I found in .../data/cache/application/services.php the following section:
'ReportSending' => '\\Espo\\Modules\\Advanced\\Services\\ReportSending', 'Workflow' => '\\Espo\\Modules\\Advanced\\Services\\Workflow', 'TestService' => '\\Espo\\Custom\\Services\\TestService', ); ?> Is there anything I can check in addition? Thank you very much
I'm trying to add an additional service action for use within a workflow according to https://www.espocrm.com/documentatio...rvice-actions/.
As described, I added an additional service class by copying the sample code and put it into ../custom/Espo/Custom/Services/TestService.php:
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class TestService extends \Espo\Core\Services\Base
{
public function testServiceAction($workflowId, Entity $entity, $additionalParameters = null)
{
//your code here
}
}
Next I added the json-File .../Resources/metadata/entityDefs/Workflow.json actually again by simply copying the sample data:
{
"serviceActions": {
"Call": {
"testServiceAction": {
"serviceName": "TestService",
"methodName": "testServiceAction"
}
}
}
}
Last, the labdel assignment in .../Resources/i18n/en_US/Workflow.json and .../Resources/i18n/de_DE/Workflow.json:
{
"serviceActions": {
"testServiceAction": "Label for TestServiceAction"
}
}
Unfortunately, nothing happens after restarting or clearing the cache and I'm really a bit lost now.
I set the logging level to debug, but in the log files are only entries that seem unrelated to my problem, but belong to the automated email sending I've set up also.
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\ActionManager: Start workflow rule ID [5ae7759a3088f4076]. [] []
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\Actions: Start [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\Actions: End [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:22:17] Espo.DEBUG: Workflow\ActionManager: End workflow rule ID [5ae7759a3088f4076]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\ActionManager: Start workflow rule ID [5ae7759a3088f4076]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\Actions: Start [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\Actions: End [sendEmail] with cid [0] for entity [Quote, 5ae0dd0d3720934c9]. [] []
[2018-05-14 13:37:15] Espo.DEBUG: Workflow\ActionManager: End workflow rule ID [5ae7759a3088f4076]. [] []
I guess the service class has been recognized properly as I found in .../data/cache/application/services.php the following section:
'ReportSending' => '\\Espo\\Modules\\Advanced\\Services\\ReportSending', 'Workflow' => '\\Espo\\Modules\\Advanced\\Services\\Workflow', 'TestService' => '\\Espo\\Custom\\Services\\TestService', ); ?> Is there anything I can check in addition? Thank you very much
Comment