Custom Workflow Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartinsar
    Member
    • Dec 2021
    • 33

    Custom Workflow Error

    Hello,
    I'm testing custom workflow for Sales Order.

    We I run process, log shows me the error with text:
    ERROR: Workflow[61f39819cf10d7209]: Action failed [runService] with cid [0], details: . [] []

    It's look like the custom code didn't even run.

    Can you help me please, thank you.

    I'm following this guide https://docs.espocrm.com/development...rvice-actions/

    This my testing workflow code located here: Espo/Custom/Services/flexibeeSync.php:

    PHP Code:
    namespace Espo\Custom\Services;
    
    use Espo\ORM\Entity;
    
    
    class flexibeeSync extends \Espo\Core\Services\Base
    {
    public function flexibeeSync($workflowId, Entity $entity, $additionalParameters = null){
    
    $url ='$entity->get('url')';
    
    $log_response = date("Y-m-d H:i:s") . '  ' . $url;
    
    file_put_contents('response-' . date("Y-m-d") .'.log', $log_response . PHP_EOL, FILE_APPEND | LOCK_EX);
    
    
    }
    
    } 
    

    metadata folder Espo/Custom/Resources/metadata/entityDefs/Workflow.json
    Code:
    
    {
    "serviceActions": {
    "SalesOrder":{
    "Flexibee Sync": {
    "serviceName": "flexibeeSync",
    "methodName": "flexibeeSync"
    }
    }
    }
    }

    and i18n folder Espo/Custom/Resources/i18n/en_US/Workflow.json

    Code:
    {
    "serviceActions": {
    "flexibeeSync": "FlexibeeSync"
    }
    }



    Click image for larger version

Name:	Screenshot 2022-01-28 092829.png
Views:	376
Size:	51.0 KB
ID:	78535
    Last edited by smartinsar; 01-28-2022, 08:30 AM.
  • smartinsar
    Member
    • Dec 2021
    • 33

    #2
    Solved.

    Comment

    Working...