Can I start a Task with java code?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2011 08:48 PM
Hi All,
Did activiti have a web-service or interface to start up a task ? I mean I have a tomcat to run a project . activiti in another tomcat . when operator start a function on the project . in the same time .activiti will started a task .
Did activiti have a web-service or interface to start up a task ? I mean I have a tomcat to run a project . activiti in another tomcat . when operator start a function on the project . in the same time .activiti will started a task .
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2011 02:12 AM
You can use the REST-API to start up a process or complete a task: http://www.activiti.org/userguide/index.html#N1196B

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2011 10:13 PM
Thanks for your help .It is useful for me .

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2011 10:48 PM
Hi Frederikheremans,
I have read the REST-API and find out the "Execute an action" in web scripts ,but I can not understand the parameter about "connectorId={connectorId}&artifactId={artifactId}&actionName={artifactActionName}" where and how can I get parameters ?
Thanks .
I have read the REST-API and find out the "Execute an action" in web scripts ,but I can not understand the parameter about "connectorId={connectorId}&artifactId={artifactId}&actionName={artifactActionName}" where and how can I get parameters ?
Thanks .
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2011 03:22 AM
Hi,
The action you are referring to is for activiti-cycle. The API's you're looking for are the ones under the Engine, Process, Repository and Management section in the userguide, eg:
Starting a process instance:
Completing a task:
The action you are referring to is for activiti-cycle. The API's you're looking for are the ones under the Engine, Process, Repository and Management section in the userguide, eg:
Starting a process instance:
Request: POST /process-instance
{
"processDefinitionId":"financialReport:1"
}
Completing a task:
Request: PUT /task/{taskId}/[claim|complete]
{}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2011 04:08 AM
So if using the provided example process of "FinancialReportProcess", what should I place for below red color id in order to execute process.
PUT /activiti-rest/service/artifact-action?connectorId={connectorId}&artifactId={artifactId}&actionName={artifactActionName}
To my understand, will it look like as this?
http://localhost:8080/activiti-rest/service/artifact-action?connectorId={FinancialReportProcess}&artifactId={StartNoneEvent}&actionName={StartNoneEvent}
PUT /activiti-rest/service/artifact-action?connectorId={connectorId}&artifactId={artifactId}&actionName={artifactActionName}
<process name="FinancialReportProcess" id="[color=#0000FF]FinancialReportProcess[/color]" isExecutable="false">
<startEvent id="[color=#8000FF]StartNoneEvent[/color]" name="[color=#FF00FF]StartNoneEvent[/color]">
<documentation id="sid-74020069-3909-434e-81f2-fc67f4f578fd">Original Name: "" Original ID: "sid-65A1BDFB-8A62-4BB7-85A7-83375147083E"</documentation>
<extensionElements>
</extensionElements>
<outgoing>SequenceFlow</outgoing>
</startEvent>
To my understand, will it look like as this?
http://localhost:8080/activiti-rest/service/artifact-action?connectorId={FinancialReportProcess}&artifactId={StartNoneEvent}&actionName={StartNoneEvent}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2011 04:27 AM
To start the process "FinancialReportProcess", you should call the folowing REST:
and this will return something like the following JSON, indicating the process was started:
Please not that the process-definition ID mentioned above assumes there is only one version of the financial process deployed. To get all deployed definition to be sure you use the correct processDefinitionId, you can use:
POST /process-instance
{
"processDefinitionId":"FinancialReportProcess:1"
}
and this will return something like the following JSON, indicating the process was started:
{
"id": "217",
"processDefinitionId": "financialReport:1",
"activityNames": ["firstTaskInProcess"],
"ended": false
}
Please not that the process-definition ID mentioned above assumes there is only one version of the financial process deployed. To get all deployed definition to be sure you use the correct processDefinitionId, you can use:
GET /process-definitions?start=0&size=100

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2011 09:55 PM
Hi Frederikheremans ,
Thanks for your reply, I have read online document and try to create a path to call webscript, my path is :
http://localhost:8080/activiti-rest/service/process-instance?processDefinitionId=FinancialReportProc...
I can not get anything yet . return is "File not found". can you help me to create the true path?
Thanks All.
Thanks for your reply, I have read online document and try to create a path to call webscript, my path is :
http://localhost:8080/activiti-rest/service/process-instance?processDefinitionId=FinancialReportProc...
I can not get anything yet . return is "File not found". can you help me to create the true path?
Thanks All.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2011 10:02 PM
Hi All,
Who can help me how to create the real path? I have try many time and return result is same message : " File not found " .
Thanks all.
Who can help me how to create the real path? I have try many time and return result is same message : " File not found " .
Thanks all.
