cancel
Showing results for 
Search instead for 
Did you mean: 

How to systematically 'Approve' or 'Reject' a SimpleWorkflow

hyperation
Champ on-the-rise
Champ on-the-rise
Hi,

I am having trouble figuring out how to use Web Script to systematically 'Approve'/'Reject' a Simple Workflow item.

I made a Web Script that creates a "simple-workflow" Action and sets the approved destination and reject destination.  This script is working and all, but now I need the system to automatically "Approve" or "Reject" the Simple Workflow item.

I am doing this for a custom UI that does AJAX calls to a webscripts to do all the "actions".

It would be nice if there is something like..

node.execute("theAction")

..for Web Scripts.

Thanks
Smiley Happy
5 REPLIES 5

hyperation
Champ on-the-rise
Champ on-the-rise
Any help?

I just need to trigger the "Approve" or "Reject" Action for the simple-workflow.

Thanks
Smiley Happy

mrogers
Star Contributor
Star Contributor
Assuming that you have an active workflow task in the correct state you can signal a transition from either the Java or Java Script API.     The workflow engine will then move on according to your workflow definition.

http://wiki.alfresco.com/wiki/Workflow_Reqs_and_Design#Workflow_APIs

/**
* Signal the transition from one Workflow Node to another
*
* @param pathId  the workflow path to signal on
* @param transition  the transition to follow (or null, for the default transition)
* @return  the updated workflow path
*/
@Auditable(parameters = {"pathId", "transitionId"})
public WorkflowPath signal(String pathId, String transitionId);

jmi9999
Champ in-the-making
Champ in-the-making
Do you have the solution ?

Thanks in advance
JMi

jmi9999
Champ in-the-making
Champ in-the-making
I tried this but, no way.  I am really a big fan of these forums where there is no activity.  Really.


            var myAction = actions.create("simple-workflow");
            myAction.parameters.name = "MY_setReadyForValidation";
            myAction.parameters["approve-move"] = true;
            myAction.parameters["approve-step"] = "Accept";
            // execute action against a document   
            result.nodeRef = myAction.execute(fileNode);

rudyanto
Champ in-the-making
Champ in-the-making
In the contrary, I need to assign a confirmation dialog to every button clicked in a workflow node. The purpose is anticipating misclicking (click a wrong button). Can anyone show the way?

I just need to show "Are you sure?" and show YES button and NO button.

Best Regards,
rudyanto
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.