Just wondering what I need to put in a script or page to signal that the task has been completed. The manual web task is linking to a form, and once it's been submitted I want to tell Maestro that things are done and to move on.

I'm assuming I need to put something in the form submission handler, but what?

Comments

_randy’s picture

If you look at the manual web example from the test flows, we've shown a super simplified way to complete a task via ajax.

However what you need to do is signal that a task is done via the completeTask Maestro method.
Kind of like this:

$maestro = Maestro::createMaestroObject(1); // Initiate the processing of all tasks of type 1.x
$queue_id = intval($queue_id);
$maestro->engine()->completeTask($queue_id);

ryan.armstrong’s picture

Awesome, just for records sake, to get the queue_id, I used this code:

$queue_id=check_plain($_GET['queueid']);

ryan.armstrong’s picture

Status: Active » Fixed

closing

ryan.armstrong’s picture

Status: Fixed » Active

Quick follow up question, I see that the manual web task process passes the queue_id so that I can grab it via _GET, but is that all it passes? What is the best way to get the process_id?

enggajb’s picture

Hi, I am facing the same issue with Maestro 1.0 module. Can you guys plz let me know, where I need to place this code exactly?

I have placed this into webform_hooks.php file as given below:

function hook_webform_submission_load(&$submissions) {
foreach ($submissions as $sid => $submission) {
$submissions[$sid]->new_property = 'foo';
$mastro=Maestro::createMaestroObject(1);
$queue_id=check_pain($_GET['queueid']);
$maestro->engine()->completeTask($queue_id);
}

but nothing happen. Look forward for your reply.

Regards,
Amit

_randy’s picture

@enggajb: Not quite sure what you're trying to do, but first things first -- you should read up on hooks. Your custom module would use a hook from either core or exposed by a module in order for your code to run.

Manual web tasks need to be signaled that they are complete. See the example Manual web task in the Maestro sample flows for how to do this.

_randy’s picture

Status: Active » Closed (fixed)

Moving this to closed.