use workflow defined in java

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2009 09:06 AM
Hi everyone,
It is the first time I'm using workflow. Before, I've created my own but now I need to use built-in workflow capabilities of Alfresco. That is the scenario:
1. After I've started Alfresco server, I will run a Java class. That class includes space creation, group creation and permission settings of these groups on these spaces. They are all done.
2. Now I need to define a simple workflow in Java. I couldn't find any example. I want to create something like that:
Whenever a document uploaded/created in a space -let's call it as Sapce1-, assign that document to a group. That is it for the java part.
3. I've seen on the web-client part of the Alfresco that if we have defined Approve/Reject like workflow for the document, after assigned user selects Approve or Reject that document automatically acts according to defined workflow. Here's my problem: How can i make the decision on the javascript side? I mean via a GUI like Flex, user sends approve message, how can I execute 'approve' on the document? With which command/function?
Thanks a lot…
It is the first time I'm using workflow. Before, I've created my own but now I need to use built-in workflow capabilities of Alfresco. That is the scenario:
1. After I've started Alfresco server, I will run a Java class. That class includes space creation, group creation and permission settings of these groups on these spaces. They are all done.
2. Now I need to define a simple workflow in Java. I couldn't find any example. I want to create something like that:
Whenever a document uploaded/created in a space -let's call it as Sapce1-, assign that document to a group. That is it for the java part.
3. I've seen on the web-client part of the Alfresco that if we have defined Approve/Reject like workflow for the document, after assigned user selects Approve or Reject that document automatically acts according to defined workflow. Here's my problem: How can i make the decision on the javascript side? I mean via a GUI like Flex, user sends approve message, how can I execute 'approve' on the document? With which command/function?
Thanks a lot…
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2009 12:30 AM
The Workflow JavaScript API provides a command (signal) to cause the workflow to take a predefined transition path. The path is described in the processdefinition.xml file you configure. You can use a webscript to signal the transition from any web application.
http://wiki.alfresco.com/wiki/Workflow_JavaScript_API#Overview
http://wiki.alfresco.com/wiki/Workflow_JavaScript_API#Overview

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2009 05:44 PM
Thanks for your reply but i need a Java example,tutorial, code snippet etc. I want to describe a worklow that consists back/forward (approve/reject) mechanism only. It must be 10 lines of code but I couldn't do it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2009 03:51 AM
there is no lowlevel workflow API to run your own workflow. YOu have to define it in JPDL and deploy it. Then, you can trigger the actions from java.
Norgan
Norgan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2009 08:55 AM
Thanks Norgan. I've been reading Alfresco Developer Guide for 2 3 days and I've seen a code snippet:
Map<QName, Serializable> workflowParameters = new HashMap<QName,Serializable>();
workflowParameters.put(QName.createQName("bpm", "assignee"),"tuser1");
workflowParameters.put(QName.createQName("bpm", "description"),"Started from Foundation");
workflowService.startWorkflow("jbpm$wf:adhoc", workflowParameters);
That's way I've asked that question. I want to learn what can be the workflowParameters. Why is this code not enough for defining a new workflow?
Map<QName, Serializable> workflowParameters = new HashMap<QName,Serializable>();
workflowParameters.put(QName.createQName("bpm", "assignee"),"tuser1");
workflowParameters.put(QName.createQName("bpm", "description"),"Started from Foundation");
workflowService.startWorkflow("jbpm$wf:adhoc", workflowParameters);
That's way I've asked that question. I want to learn what can be the workflowParameters. Why is this code not enough for defining a new workflow?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2009 09:47 AM
workflow parameters is an arbitary map of values given to start an instance of your workflow. The analogy in Java would be the list of properties you pass into a constructor to create a new instance of a class.
The api you are looking at creates a new instance of a workflow.
It does not define what the workflow is. To define a workflow you need to create a workflow definition which is an XML file containing JBPM.
The api you are looking at creates a new instance of a workflow.
It does not define what the workflow is. To define a workflow you need to create a workflow definition which is an XML file containing JBPM.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2009 10:39 AM
workflow parameters is an arbitary map of values given to start an instance of your workflow. The analogy in Java would be the list of properties you pass into a constructor to create a new instance of a class.
The api you are looking at creates a new instance of a workflow.
It does not define what the workflow is. To define a workflow you need to create a workflow definition which is an XML file containing JBPM.
to emphasize what you said : The api you are looking at creates a new instance of a specific type of workflow, which may not match your requirements.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2009 04:40 AM
Thank you a lot guys…
