提交 9efc266d 编写于 作者: J Joram Barrez

Merge branch 'master' of github.com:Activiti/Activiti

......@@ -54,7 +54,7 @@ public class SignalAndMessageDefinitionExport implements BpmnXMLConstants {
xtw.writeStartElement(ELEMENT_MESSAGE);
String messageId = message.getId();
// remove the namespace from the message id if set
if (messageId.startsWith(model.getTargetNamespace())) {
if (model.getTargetNamespace() != null && messageId.startsWith(model.getTargetNamespace())) {
messageId = messageId.replace(model.getTargetNamespace(), "");
messageId = messageId.replaceFirst(":", "");
} else {
......
......@@ -29,22 +29,36 @@ import org.activiti.engine.TaskService;
*/
public class ActivitiUtil {
private static ActivitiUtilProvider activitiProvider;
public static void setActivitiProvider(ActivitiUtilProvider provider) {
activitiProvider = provider;
}
/**
* Returns the process engine info.
*
* @return The process engine info
*/
public static ProcessEngineInfo getProcessEngineInfo() {
return ProcessEngines.getProcessEngineInfo(ProcessEngines.NAME_DEFAULT);
if (activitiProvider != null) {
return activitiProvider.getProcessEngineInfo();
} else {
return ProcessEngines.getProcessEngineInfo(ProcessEngines.NAME_DEFAULT);
}
}
/**
* Returns the process engine.
*
* @return The process engine
*/
public static ProcessEngine getProcessEngine() {
return ProcessEngines.getDefaultProcessEngine();
if (activitiProvider != null) {
return activitiProvider.getProcessEngine();
} else {
return ProcessEngines.getDefaultProcessEngine();
}
}
/**
......
package org.activiti.rest.api;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineInfo;
/**
*
* @author fers
*/
public interface ActivitiUtilProvider {
public ProcessEngine getProcessEngine();
public ProcessEngineInfo getProcessEngineInfo();
}
\ No newline at end of file
......@@ -126,6 +126,8 @@ public abstract class ProcessEngineConfiguration implements EngineServices {
protected boolean jpaHandleTransaction;
protected boolean jpaCloseEntityManager;
protected String databaseTablePrefix = "";
protected String xmlEncoding = "UTF-8";
protected String defaultCamelContext = "camelContext";
protected String activityFontName = "Arial";
......@@ -549,4 +551,21 @@ public abstract class ProcessEngineConfiguration implements EngineServices {
public void setLabelFontName(String labelFontName) {
this.labelFontName = labelFontName;
}
public ProcessEngineConfiguration setDatabaseTablePrefix(String databaseTablePrefix) {
this.databaseTablePrefix = databaseTablePrefix;
return this;
}
public String getDatabaseTablePrefix() {
return databaseTablePrefix;
}
public String getXmlEncoding() {
return xmlEncoding;
}
public void setXmlEncoding(String xmlEncoding) {
this.xmlEncoding = xmlEncoding;
}
}
......@@ -16,6 +16,7 @@ import java.util.Date;
import org.activiti.engine.ActivitiException;
import org.joda.time.DateTime;
import org.joda.time.Period;
public class DueDateBusinessCalendar implements BusinessCalendar {
......@@ -24,6 +25,12 @@ public class DueDateBusinessCalendar implements BusinessCalendar {
public Date resolveDuedate(String duedate) {
try {
// check if due period was specified
if(duedate.startsWith("P")){
return DateTime.now().plus(Period.parse(duedate)).toDate();
}
return DateTime.parse(duedate).toDate();
} catch (Exception e) {
......
......@@ -343,8 +343,6 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
protected FailedJobCommandFactory failedJobCommandFactory;
protected String databaseTablePrefix = "";
/**
* Set this to true if you want to have extra checks on the BPMN xml that is parsed.
* See http://www.jorambarrez.be/blog/2013/02/19/uploading-a-funny-xml-can-bring-down-your-server/
......@@ -365,8 +363,6 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
protected int batchSizeProcessInstances = 25;
protected int batchSizeTasks = 25;
protected String xmlEncoding = "UTF-8";
/**
* In some situations you want to set the schema to use for table checks / generation if the database metadata
* doesn't return that correctly, see https://jira.codehaus.org/browse/ACT-1220,
......
......@@ -280,7 +280,7 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
public void initialize() {
log.debug("initializing {}", this);
ScopeImpl scope = getScope();
ScopeImpl scope = getScopeObject();
ensureParentInitialized();
// initialize the lists of referenced objects (prevents db queries)
......@@ -792,7 +792,7 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
// scopes ///////////////////////////////////////////////////////////////////
protected ScopeImpl getScope() {
protected ScopeImpl getScopeObject() {
ScopeImpl scope = null;
if (isProcessInstance()) {
scope = getProcessDefinition();
......
......@@ -22,6 +22,7 @@ import org.activiti.engine.impl.test.PluggableActivitiTestCase;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.test.Deployment;
import org.joda.time.Period;
/**
......@@ -60,4 +61,22 @@ public class TaskDueDateExtensionsTest extends PluggableActivitiTestCase {
Date date = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").parse("06-07-1986 12:10:00");
assertEquals(date, task.getDueDate());
}
@Deployment
public void testRelativeDueDateStringExtension() throws Exception {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("dateVariable", "P2DT5H40M");
// Start process-instance, passing ISO8601 duration formatted String that should be used to calculate dueDate
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("dueDateExtension", variables);
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(task.getDueDate());
Period period = new Period(task.getCreateTime().getTime(), task.getDueDate().getTime());
assertEquals(period.getDays(), 2);
assertEquals(period.getHours(), 5);
assertEquals(period.getMinutes(), 40);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="taskAssigneeExample"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn"
targetNamespace="Examples">
<process id="dueDateExtension">
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask" />
<userTask id="theTask" name="my task" activiti:dueDate="${dateVariable}" />
<sequenceFlow id="flow2" sourceRef="theTask" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
</definitions>
\ No newline at end of file
......@@ -71,6 +71,10 @@ public class ServiceTaskJsonConverter extends BaseBpmnJsonConverter {
propertiesNode.put(PROPERTY_SERVICETASK_DELEGATE_EXPRESSION, serviceTask.getImplementation());
}
if (StringUtils.isNotEmpty(serviceTask.getResultVariableName())) {
propertiesNode.put(PROPERTY_SERVICETASK_RESULT_VARIABLE, serviceTask.getResultVariableName());
}
addFieldExtensions(serviceTask.getFieldExtensions(), propertiesNode);
}
}
......@@ -90,6 +94,10 @@ public class ServiceTaskJsonConverter extends BaseBpmnJsonConverter {
task.setImplementation(getPropertyValueAsString(PROPERTY_SERVICETASK_DELEGATE_EXPRESSION, elementNode));
}
if (StringUtils.isNotEmpty(getPropertyValueAsString(PROPERTY_SERVICETASK_RESULT_VARIABLE, elementNode))) {
task.setResultVariableName(getPropertyValueAsString(PROPERTY_SERVICETASK_RESULT_VARIABLE, elementNode));
}
JsonNode fieldsNode = getProperty(PROPERTY_SERVICETASK_FIELDS, elementNode);
if (fieldsNode != null) {
JsonNode itemsArrayNode = fieldsNode.get(EDITOR_PROPERTIES_GENERAL_ITEMS);
......
......@@ -65,6 +65,9 @@ public final class RestUrls {
public static final String SEGMENT_INFO = "info";
public static final String SEGMENT_MEMBERS = "members";
public static final String SEGMENT_MODEL = "model";
public static final String SEGMENT_PROPERTIES = "properties";
public static final String SEGMENT_ENGINE_INFO = "engine";
public static final String SEGMENT_ACTIVITIES = "activities";
/**
* URL template for the deployment collection: <i>repository/deployments</i>
......@@ -224,6 +227,11 @@ public final class RestUrls {
*/
public static final String[] URL_EXECUTION_VARIABLE_DATA = {SEGMENT_RUNTIME_RESOURCES, SEGMENT_EXECUTION_RESOURCE, "{0}", SEGMENT_VARIABLES, "{1}", SEGMENT_VARIABLE_DATA};
/**
* URL template for all active activities on an execution: <i>runtime/executions/{0:executionId}/activities</i>
*/
public static final String[] URL_EXECUTION_ACTIVITIES_COLLECTION = {SEGMENT_RUNTIME_RESOURCES, SEGMENT_EXECUTION_RESOURCE, "{0}", SEGMENT_ACTIVITIES};
/**
* URL template for execution query: <i>query/executions</i>
*/
......@@ -389,6 +397,16 @@ public final class RestUrls {
*/
public static final String[] URL_JOB_COLLECTION = {SEGMENT_MANAGEMENT_RESOURCES, SEGMENT_JOBS};
/**
* URL template for the collection of properties: <i>management/properties</i>
*/
public static final String[] URL_PROPERTIES_COLLECTION = {SEGMENT_MANAGEMENT_RESOURCES, SEGMENT_PROPERTIES};
/**
* URL template for the collection of properties: <i>management/properties</i>
*/
public static final String[] URL_ENGINE_INFO = {SEGMENT_MANAGEMENT_RESOURCES, SEGMENT_ENGINE_INFO};
/**
* URL template for the collection of users: <i>identity/users</i>
*/
......
......@@ -11,7 +11,7 @@
* limitations under the License.
*/
package org.activiti.rest.api.engine;
package org.activiti.rest.api.management;
/**
* @author Tijs Rademakers
......
......@@ -11,7 +11,7 @@
* limitations under the License.
*/
package org.activiti.rest.api.engine;
package org.activiti.rest.api.management;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineInfo;
......@@ -28,11 +28,19 @@ public class ProcessEngineResource extends SecuredResource {
public ProcessEngineInfoResponse getEngineInfo() {
if(authenticate() == false) return null;
ProcessEngineInfo engineInfo = ActivitiUtil.getProcessEngineInfo();
ProcessEngineInfoResponse response = new ProcessEngineInfoResponse();
response.setName(engineInfo.getName());
response.setResourceUrl(engineInfo.getResourceUrl());
response.setException(engineInfo.getException());
ProcessEngineInfo engineInfo = ActivitiUtil.getProcessEngineInfo();
if(engineInfo != null) {
response.setName(engineInfo.getName());
response.setResourceUrl(engineInfo.getResourceUrl());
response.setException(engineInfo.getException());
} else {
// Revert to using process-engine directly
ProcessEngine engine = ActivitiUtil.getProcessEngine();
response.setName(engine.getName());
}
response.setVersion(ProcessEngine.VERSION);
return response;
}
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.rest.api.management;
import java.util.Map;
import org.activiti.rest.api.ActivitiUtil;
import org.activiti.rest.api.SecuredResource;
import org.restlet.resource.Get;
/**
* @author Frederik Heremans
*/
public class PropertiesCollectionResource extends SecuredResource {
@Get
public Map<String, String> getProperties() {
if (authenticate() == false)
return null;
return ActivitiUtil.getManagementService().getProperties();
}
}
......@@ -28,6 +28,7 @@ public class ProcessDefinitionActionRequest extends RestActionRequest {
private boolean includeProcessInstances = false;
private Date date;
private String category;
public void setIncludeProcessInstances(boolean includeProcessInstances) {
this.includeProcessInstances = includeProcessInstances;
......@@ -41,4 +42,10 @@ public class ProcessDefinitionActionRequest extends RestActionRequest {
public Date getDate() {
return date;
}
public void setCategory(String category) {
this.category = category;
}
public String getCategory() {
return category;
}
}
......@@ -49,15 +49,28 @@ public class ProcessDefinitionResource extends BaseProcessDefinitionResource {
ProcessDefinition processDefinition = getProcessDefinitionFromRequest();
if(actionRequest.getAction() != null) {
if(ProcessDefinitionActionRequest.ACTION_SUSPEND.equals(actionRequest.getAction())) {
return suspendProcessDefinition(processDefinition, actionRequest.isIncludeProcessInstances(), actionRequest.getDate());
} else if(ProcessDefinitionActionRequest.ACTION_ACTIVATE.equals(actionRequest.getAction())) {
return activateProcessDefinition(processDefinition, actionRequest.isIncludeProcessInstances(), actionRequest.getDate());
if(actionRequest.getCategory() != null) {
// Update of category required
ActivitiUtil.getRepositoryService().setProcessDefinitionCategory(processDefinition.getId(), actionRequest.getCategory());
// No need to re-fetch the ProcessDefinition entity, just update category in response
ProcessDefinitionResponse response = getApplication(ActivitiRestServicesApplication.class).getRestResponseFactory()
.createProcessDefinitionResponse(this, processDefinition);
response.setCategory(actionRequest.getCategory());
return response;
} else {
// Actual action
if(actionRequest.getAction() != null) {
if(ProcessDefinitionActionRequest.ACTION_SUSPEND.equals(actionRequest.getAction())) {
return suspendProcessDefinition(processDefinition, actionRequest.isIncludeProcessInstances(), actionRequest.getDate());
} else if(ProcessDefinitionActionRequest.ACTION_ACTIVATE.equals(actionRequest.getAction())) {
return activateProcessDefinition(processDefinition, actionRequest.isIncludeProcessInstances(), actionRequest.getDate());
}
}
throw new ActivitiIllegalArgumentException("Invalid action: '" + actionRequest.getAction() + "'.");
}
throw new ActivitiIllegalArgumentException("Invalid action: '" + actionRequest.getAction() + "'.");
}
protected ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances, Date date) {
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.rest.api.runtime.process;
import java.util.List;
import org.activiti.engine.runtime.Execution;
import org.activiti.rest.api.ActivitiUtil;
import org.restlet.resource.Get;
/**
* @author Frederik Heremans
*/
public class ExecutionActiveActivitiesCollectionResource extends ExecutionBaseResource {
@Get
public List<String> getActiveActivities() {
if(!authenticate()) {
return null;
}
Execution execution = getExecutionFromRequest();
return ActivitiUtil.getRuntimeService().getActiveActivityIds(execution.getId());
}
}
package org.activiti.rest.application;
import org.activiti.rest.api.engine.ProcessEngineResource;
import org.activiti.rest.api.history.HistoricActivityInstanceCollectionResource;
import org.activiti.rest.api.history.HistoricActivityInstanceQueryResource;
import org.activiti.rest.api.history.HistoricDetailCollectionResource;
......@@ -67,6 +66,8 @@ import org.activiti.rest.api.legacy.task.LegacyTaskResource;
import org.activiti.rest.api.management.JobCollectionResource;
import org.activiti.rest.api.management.JobExceptionStacktraceResource;
import org.activiti.rest.api.management.JobResource;
import org.activiti.rest.api.management.ProcessEngineResource;
import org.activiti.rest.api.management.PropertiesCollectionResource;
import org.activiti.rest.api.management.TableCollectionResource;
import org.activiti.rest.api.management.TableColumnsResource;
import org.activiti.rest.api.management.TableDataResource;
......@@ -83,6 +84,7 @@ import org.activiti.rest.api.repository.ProcessDefinitionModelResource;
import org.activiti.rest.api.repository.ProcessDefinitionResource;
import org.activiti.rest.api.repository.ProcessDefinitionResourceDataResource;
import org.activiti.rest.api.repository.SimpleWorkflowResource;
import org.activiti.rest.api.runtime.process.ExecutionActiveActivitiesCollectionResource;
import org.activiti.rest.api.runtime.process.ExecutionCollectionResource;
import org.activiti.rest.api.runtime.process.ExecutionQueryResource;
import org.activiti.rest.api.runtime.process.ExecutionResource;
......@@ -168,6 +170,7 @@ public class RestServicesInit {
router.attach("/runtime/executions", ExecutionCollectionResource.class);
router.attach("/runtime/executions/{executionId}", ExecutionResource.class);
router.attach("/runtime/executions/{executionId}/activities", ExecutionActiveActivitiesCollectionResource.class);
router.attach("/runtime/executions/{executionId}/variables", ExecutionVariableCollectionResource.class);
router.attach("/runtime/executions/{executionId}/variables/{variableName}", ExecutionVariableResource.class);
router.attach("/runtime/executions/{executionId}/variables/{variableName}/data", ExecutionVariableDataResource.class);
......@@ -191,6 +194,8 @@ public class RestServicesInit {
router.attach("/management/jobs", JobCollectionResource.class);
router.attach("/management/jobs/{jobId}", JobResource.class);
router.attach("/management/jobs/{jobId}/exception-stacktrace", JobExceptionStacktraceResource.class);
router.attach("/management/properties", PropertiesCollectionResource.class);
router.attach("/management/engine", ProcessEngineResource.class);
router.attach("/identity/users", UserCollectionResource.class);
router.attach("/identity/users/{userId}", UserResource.class);
......
package org.activiti.rest.api.management;
import java.util.Iterator;
import java.util.Map;
import org.activiti.rest.BaseRestTestCase;
import org.activiti.rest.api.RestUrls;
import org.codehaus.jackson.JsonNode;
import org.restlet.data.Status;
import org.restlet.representation.Representation;
import org.restlet.resource.ClientResource;
/**
* Test for all REST-operations related to the Job collection and a single
* job resource.
*
* @author Frederik Heremans
*/
public class PropertiesCollectionResourceTest extends BaseRestTestCase {
/**
* Test getting the engine properties.
*/
public void testGetProperties() throws Exception {
ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROPERTIES_COLLECTION));
Representation response = client.get();
assertEquals(Status.SUCCESS_OK, client.getResponse().getStatus());
Map<String, String> properties = managementService.getProperties();
JsonNode responseNode = objectMapper.readTree(response.getStream());
assertNotNull(responseNode);
assertEquals(properties.size(), responseNode.size());
Iterator<Map.Entry<String, JsonNode>> nodes = responseNode.getFields();
Map.Entry<String, JsonNode> node = null;
while(nodes.hasNext()) {
node = nodes.next();
String propValue = properties.get(node.getKey());
assertNotNull(propValue);
assertEquals(propValue, node.getValue().getTextValue());
}
}
}
\ No newline at end of file
......@@ -375,5 +375,31 @@ public class ProcessDefinitionResourceTest extends BaseRestTestCase {
assertEquals("Could not find a process definition with id 'unexisting'.", client.getResponse().getStatus().getDescription());
}
}
/**
* Test activating a suspended process definition delayed.
* POST repository/process-definitions/{processDefinitionId}
*/
@Deployment(resources={"org/activiti/rest/api/repository/oneTaskProcess.bpmn20.xml"})
public void testUpdateProcessDefinitionCategory() throws Exception {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionCategory("OneTaskCategory").count());
ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_DEFINITION, processDefinition.getId()));
ObjectNode requestNode = objectMapper.createObjectNode();
requestNode.put("category", "updatedcategory");
Representation response = client.put(requestNode);
// Check "OK" status
assertEquals(Status.SUCCESS_OK, client.getResponse().getStatus());
JsonNode responseNode = objectMapper.readTree(response.getStream());
assertEquals("updatedcategory", responseNode.get("category").getTextValue());
// Check actual entry in DB
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionCategory("updatedcategory").count());
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.rest.api.runtime;
import java.util.HashSet;
import java.util.Set;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.Deployment;
import org.activiti.rest.BaseRestTestCase;
import org.activiti.rest.api.RestUrls;
import org.codehaus.jackson.JsonNode;
import org.restlet.data.Status;
import org.restlet.representation.Representation;
import org.restlet.resource.ClientResource;
/**
* @author Frederik Heremans
*/
public class ExecutionActiveActivitiesCollectionResourceTest extends BaseRestTestCase {
@Deployment
public void testGetActivities() throws Exception {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("processOne");
ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_ACTIVITIES_COLLECTION, processInstance.getId()));
Representation response = client.get();
assertEquals(Status.SUCCESS_OK, client.getResponse().getStatus());
// Check resulting instance
JsonNode responseNode = objectMapper.readTree(response.getStream());
assertNotNull(responseNode);
assertTrue(responseNode.isArray());
assertEquals(2, responseNode.size());
Set<String> states = new HashSet<String>();
states.add(responseNode.get(0).getTextValue());
states.add(responseNode.get(1).getTextValue());
assertTrue(states.contains("waitState"));
assertTrue(states.contains("anotherWaitState"));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn"
targetNamespace="Examples" xmlns:tns="Examples">
<process id="processOne" name="The One Task Process">
<documentation>One task process description</documentation>
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="fork" />
<parallelGateway id="fork" />
<sequenceFlow sourceRef="fork" targetRef="waitState" />
<sequenceFlow sourceRef="fork" targetRef="anotherWaitState" />
<receiveTask id="waitState" name="wait" />
<receiveTask id="anotherWaitState" name="wait 2" />
<sequenceFlow id="flow3" sourceRef="anotherWaitState" targetRef="theEnd" />
<sequenceFlow id="flow4" sourceRef="waitState" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
</definitions>
\ No newline at end of file
......@@ -1614,7 +1614,7 @@ ProcessDiagramCanvas.prototype = {
drawCollapsedCallActivity: function(name, x, y, width, height) {
this.g.setStart();
this.drawCollapsedTask(name, x, y, width, height, true);
this._drawCollapsedTask(name, x, y, width, height, true);
var set = this.g.setFinish();
this.addHandlers(set, x, y, width, height, "task");
},
......
......@@ -2781,8 +2781,8 @@ assertEquals("Ship Order", task.getName());</programlisting>
<para>
There is an activity extension which allows you to specify an expression in your task-definition to set the initial due
date of a task when it is created. The expression <emphasis role="bold">should always resolve to a <literal>java.util.Date</literal>,
<literal>java.util.String (ISO8601 formatted)</literal> or <literal>null</literal></emphasis>.
For example, you could use a date that was entered in a previous form in the process or calculated in a previous Service Task.
<literal>java.util.String (ISO8601 formatted)</literal>, ISO8601 time-duration (eg. PT50M) or <literal>null</literal></emphasis>.
For example, you could use a date that was entered in a previous form in the process or calculated in a previous Service Task. In case a time-duration is used, the due-date is calculated based on the current time, incremented by the given period. For example, when "PT30M" is used as dueDate, the task is due in thirty minutes from now.
</para>
<programlisting>
&lt;userTask id=&quot;theTask&quot; name=&quot;Important task&quot; <emphasis role="bold">activiti:dueDate=&quot;${dateVariable}&quot;</emphasis>/&gt;</programlisting>
......
......@@ -1177,6 +1177,49 @@
</para>
</section>
<section>
<title>Update category for a single process definition</title>
<para>
<programlisting>PUT repository/process-definitions/{processDefinitionId}</programlisting>
</para>
<para>
<emphasis role="bold">Body JSON:</emphasis>
<programlisting>
{
"category" : "updatedcategory"
}</programlisting>
</para>
<para>
<table>
<title>Response codes</title>
<tgroup cols='2'>
<thead>
<row>
<entry>Response code</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>200</entry>
<entry>Indicates the process was category was altered.</entry>
</row>
<row>
<entry>400</entry>
<entry>Indicates no category was defined in the request body.</entry>
</row>
<row>
<entry>404</entry>
<entry>Indicates the requested process definition was not found.</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<emphasis role="bold">Success response body:</emphasis> see response for <literal>repository/process-definitions/{processDefinitionId}</literal>.
</para>
</section>
<section>
<title>Get a process definition resource content</title>
<para>
......@@ -4498,6 +4541,83 @@ Only the attachment name is required to create a new attachment.
</section>
<section>
<title>Engine</title>
<section>
<title>Get engine properties</title>
<para>
<programlisting>GET management/properties</programlisting>
</para>
<para>
Returns a read-only view of the properties used internally in the engine.
</para>
<para>
<emphasis role="bold">Success response body:</emphasis>
<programlisting>
{
"next.dbid":"101",
"schema.history":"create(5.13)",
"schema.version":"5.13"
}</programlisting>
<table>
<title>Response codes</title>
<tgroup cols='2'>
<thead>
<row>
<entry>Response code</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>200</entry>
<entry>Indicates the properties are returned.</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
<section>
<title>Get engine info</title>
<para>
<programlisting>GET management/engine</programlisting>
</para>
<para>
Returns a read-only view of the engine that is used in this REST-service.
</para>
<para>
<emphasis role="bold">Success response body:</emphasis>
<programlisting>
{
"name":"default",
"version":"5.13",
"resourceUrl":"file://activiti/activiti.cfg.xml",
"exception":null
}</programlisting>
<table>
<title>Response codes</title>
<tgroup cols='2'>
<thead>
<row>
<entry>Response code</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>200</entry>
<entry>Indicates the engine info is returned.</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
</section>
<section>
<title>Jobs</title>
<section>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册