How is a job moved from "submitted" to "received?"
Currently I have a custom provider that successfully reaches the submitted stage. I'm running into issues transitioning it to the Received stage though. Currently I'm editing the status of the job and the nodes and saving the changes with the jobService. I manually updating the node status
where _jobService is a reference to the translation manager job service. I originally had just _jobService.Save. That updated the job status, but not the node status, so I wasn't able to review the nodes in order to approve them.
Is this the correct approach and I'm just missing something, or is this supposed to be run through the Check method on the provider?
I'm not using the Check method currently, as the transition is started by an api callback passed to the external translation service, to minimize the risk of hitting api rate limits. I can add support for that check method in a way that avoids that without too much trouble, but I want to clarify what it's supposed to do before diving into that.
The short answer is you don't need to change the node or job status as part of the provider - instead set the 'Translated' value on all Translation Values in the nodes/job to True and the job will move to Received as part of the process.
If you are using a callback and not going via check you should be able to use ReturnJob(TranslationJob job) on the TranslationJobService as this will call the UpdateJobAndNodeStatus method which checks the status and it will also fire the received event, so things like notifications still work. (I say should I am not actually sure if we have a live provider using this method at the moment, but we do have the code there)
A longer answer:
After a job is checked and the translation provider returns success - the main translation service call will check the status of the translation nodes/values to determine the status of the job.
This is done by recursing into all nodes and then translation values to look at the Translated boolean value on all TranslationValues in a node's target property (only nodes with no child values have to have this value set to true)
if all values in a node have Translated = true, that node is set to 'Reviewing'
if all nodes in a job are set to reviewing the job is set to Received
if only some of the nodes are set to Reviewing the job is set to Partial.
How is a job moved from "submitted" to "received?"
Currently I have a custom provider that successfully reaches the submitted stage. I'm running into issues transitioning it to the Received stage though. Currently I'm editing the status of the job and the nodes and saving the changes with the jobService. I manually updating the node status
and then save the changes.
where _jobService is a reference to the translation manager job service. I originally had just _jobService.Save. That updated the job status, but not the node status, so I wasn't able to review the nodes in order to approve them.
Is this the correct approach and I'm just missing something, or is this supposed to be run through the Check method on the provider?
I'm not using the Check method currently, as the transition is started by an api callback passed to the external translation service, to minimize the risk of hitting api rate limits. I can add support for that check method in a way that avoids that without too much trouble, but I want to clarify what it's supposed to do before diving into that.
Hi
The short answer is you don't need to change the node or job status as part of the provider - instead set the 'Translated' value on all
Translation
Values in the nodes/job to True and the job will move to Received as part of the process.If you are using a callback and not going via check you should be able to use
ReturnJob(TranslationJob job)
on the TranslationJobService as this will call theUpdateJobAndNodeStatus
method which checks the status and it will also fire the received event, so things like notifications still work. (I say should I am not actually sure if we have a live provider using this method at the moment, but we do have the code there)A longer answer:
After a job is checked and the translation provider returns success - the main translation service call will check the status of the translation nodes/values to determine the status of the job.
This is done by recursing into all nodes and then translation values to look at the
Translated
boolean value on all TranslationValues in a node's target property (only nodes with no child values have to have this value set to true)if all values in a node have Translated = true, that node is set to 'Reviewing'
if all nodes in a job are set to
reviewing
the job is set toReceived
if only some of the nodes are set to
Reviewing
the job is set toPartial
.Thanks for the clarification Kevin. That did the trick for me.
is working on a reply...