提交 f764dcf3 编写于 作者: T tijsrademakers

Userguide cleanup

上级 2356c838
......@@ -27,6 +27,7 @@ import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.Picture;
import org.activiti.engine.identity.User;
import org.activiti.engine.impl.util.IoUtil;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.Model;
import org.apache.commons.io.IOUtils;
import org.codehaus.jackson.map.ObjectMapper;
......@@ -44,17 +45,41 @@ public class DemoDataGenerator implements ModelDataJsonConstants {
protected IdentityService identityService;
protected RepositoryService repositoryService;
protected boolean createDemoUsersAndGroups;
protected boolean createDemoProcessDefinitions;
protected boolean createDemoModels;
public void setProcessEngine(ProcessEngine processEngine) {
this.processEngine = processEngine;
this.identityService = processEngine.getIdentityService();
this.repositoryService = processEngine.getRepositoryService();
initDemoGroups();
initDemoUsers();
initProcessDefinitions();
initModelData();
if (createDemoUsersAndGroups) {
initDemoGroups();
initDemoUsers();
}
if (createDemoProcessDefinitions) {
initProcessDefinitions();
}
if (createDemoModels) {
initModelData();
}
}
public void setCreateDemoUsersAndGroups(boolean createDemoUsersAndGroups) {
this.createDemoUsersAndGroups = createDemoUsersAndGroups;
}
public void setCreateDemoProcessDefinitions(boolean createDemoProcessDefinitions) {
this.createDemoProcessDefinitions = createDemoProcessDefinitions;
}
public void setCreateDemoModels(boolean createDemoModels) {
this.createDemoModels = createDemoModels;
}
protected void initDemoGroups() {
String[] assignmentGroups = new String[] {"management", "sales", "marketing", "engineering"};
for (String groupId : assignmentGroups) {
......@@ -133,18 +158,22 @@ public class DemoDataGenerator implements ModelDataJsonConstants {
}
protected void initProcessDefinitions() {
processEngine.getRepositoryService()
.createDeployment()
.name("Demo processes")
.addClasspathResource("org/activiti/explorer/demo/process/createTimersProcess.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/VacationRequest.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/VacationRequest.png")
.addClasspathResource("org/activiti/explorer/demo/process/FixSystemFailureProcess.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/FixSystemFailureProcess.png")
.addClasspathResource("org/activiti/explorer/demo/process/Helpdesk.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/Helpdesk.png")
.addClasspathResource("org/activiti/explorer/demo/process/reviewSalesLead.bpmn20.xml")
.deploy();
List<Deployment> deploymentList = repositoryService.createDeploymentQuery().deploymentName("Demo processes").list();
if (deploymentList == null || deploymentList.size() == 0) {
repositoryService.createDeployment()
.name("Demo processes")
.addClasspathResource("org/activiti/explorer/demo/process/createTimersProcess.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/VacationRequest.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/VacationRequest.png")
.addClasspathResource("org/activiti/explorer/demo/process/FixSystemFailureProcess.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/FixSystemFailureProcess.png")
.addClasspathResource("org/activiti/explorer/demo/process/Helpdesk.bpmn20.xml")
.addClasspathResource("org/activiti/explorer/demo/process/Helpdesk.png")
.addClasspathResource("org/activiti/explorer/demo/process/reviewSalesLead.bpmn20.xml")
.deploy();
}
}
protected void initModelData() {
......@@ -152,28 +181,33 @@ public class DemoDataGenerator implements ModelDataJsonConstants {
}
protected void createModelData(String name, String description, String jsonFile) {
Model model = repositoryService.newModel();
model.setName(name);
List<Model> modelList = repositoryService.createModelQuery().modelName("Demo model").list();
ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
modelObjectNode.put(MODEL_NAME, name);
modelObjectNode.put(MODEL_DESCRIPTION, description);
model.setMetaInfo(modelObjectNode.toString());
repositoryService.saveModel(model);
try {
InputStream svgStream = this.getClass().getClassLoader().getResourceAsStream("org/activiti/explorer/demo/model/test.svg");
repositoryService.addModelEditorSourceExtra(model.getId(), IOUtils.toByteArray(svgStream));
} catch(Exception e) {
LOGGER.log(Level.WARNING, "Failed to read SVG", e);
}
if (modelList == null || modelList.size() == 0) {
try {
InputStream editorJsonStream = this.getClass().getClassLoader().getResourceAsStream(jsonFile);
repositoryService.addModelEditorSource(model.getId(), IOUtils.toByteArray(editorJsonStream));
} catch(Exception e) {
LOGGER.log(Level.WARNING, "Failed to read editor JSON", e);
Model model = repositoryService.newModel();
model.setName(name);
ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
modelObjectNode.put(MODEL_NAME, name);
modelObjectNode.put(MODEL_DESCRIPTION, description);
model.setMetaInfo(modelObjectNode.toString());
repositoryService.saveModel(model);
try {
InputStream svgStream = this.getClass().getClassLoader().getResourceAsStream("org/activiti/explorer/demo/model/test.svg");
repositoryService.addModelEditorSourceExtra(model.getId(), IOUtils.toByteArray(svgStream));
} catch(Exception e) {
LOGGER.log(Level.WARNING, "Failed to read SVG", e);
}
try {
InputStream editorJsonStream = this.getClass().getClassLoader().getResourceAsStream(jsonFile);
repositoryService.addModelEditorSource(model.getId(), IOUtils.toByteArray(editorJsonStream));
} catch(Exception e) {
LOGGER.log(Level.WARNING, "Failed to read editor JSON", e);
}
}
}
......
......@@ -11,6 +11,9 @@
<bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator">
<property name="processEngine" ref="processEngine" />
<property name="createDemoUsersAndGroups" value="true" />
<property name="createDemoProcessDefinitions" value="true" />
<property name="createDemoModels" value="true" />
</bean>
<bean id="dbProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
......
......@@ -11,7 +11,7 @@
follow these steps to get the demo setup running with default settings.
You'll need a working <ulink url="http://java.sun.com/javase/downloads/index.jsp">Java runtime</ulink> and
<ulink url="http://tomcat.apache.org/download-70.cgi">Apache Tomcat</ulink> installation (Actually,
any web container would work since we only rely on servlet capablility. But we test on Tomcat primarily).
any web container would work since we only rely on the servlet capablility. But we test on Tomcat primarily).
<itemizedlist>
<listitem>
<para>Copy the downloaded activiti-explorer.war to the webapps directory of Tomcat.</para>
......@@ -104,6 +104,26 @@
</para>
</section>
<section id="activiti.setup.database">
<title>Activiti database setup</title>
<para>As said in the one minute demo setup, the Activiti Explorer runs an in-memory H2 database by default.
To run the Activiti Explorer with a standalone H2 or another database the db.properties in the WEB-INF/classes of the Activiti Explorer web application
should be changed.
</para>
<para>In addition, be aware that the Activiti Explorer generates demo user and groups, process definitions and models by default.
To disable this, the activiti-standalone-context.xml file in the WEB-INF folder should be changed. To disable the demo setup fully you can use the following snippet
of the demoDataGenerator bean definition. But as you can see you can also enable and disable items individually.
</para>
<programlisting>
&lt;bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator">
&lt;property name="processEngine" ref="processEngine" />
&lt;property name="createDemoUsersAndGroups" value="false" />
&lt;property name="createDemoProcessDefinitions" value="false" />
&lt;property name="createDemoModels" value="false" />
&lt;/bean>
</programlisting>
</section>
<section id="getting.started.including.libs">
<title>Include the Activiti jar and its dependencies</title>
......
......@@ -16,15 +16,10 @@
<section id="bpmnDefiningProcess">
<title>Defining a process</title>
<para>
To create a new BPMN 2.0 process definition, it's best to have your Eclipse
<link linkend="eclipsesetup">properly set up</link>.
</para>
<para>
Create a new XML file (<emphasis>rightclick on any project and select New->Other->XML-XML File</emphasis>) and give it a name.
Make sure that the file <emphasis role="bold">ends with .bpmn20.xml</emphasis>, since
Make sure that the file <emphasis role="bold">ends with .bpmn20.xml or .bpmn</emphasis>, since
otherwise the engine won't pick up this file for deployment.
<mediaobject><imageobject><imagedata align="center" fileref="images/new.bpmn.procdef.png"/></imageobject></mediaobject>
</para>
......@@ -50,8 +45,8 @@
</para>
<para>
Optionally you can also add the online schemalocation of the BPMN 2.0 XML schema,
as an alternative to the <link linkend="eclipsesetup">XML catalog configuration in Eclipse</link>.
Optionally you can also add the online schema location of the BPMN 2.0 XML schema,
as an alternative to the XML catalog configuration in Eclipse.
<programlisting>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL
......@@ -109,7 +104,6 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL
<para>
This tutorial assumes that you have the <link linkend="demo.setup.one.minute.version">Activiti demo setup running</link>.
Optionally, you should also have an Eclipse installed and <link linkend="eclipsesetup">imported the Activiti examples</link>.
</para>
</section>
......@@ -139,13 +133,7 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL
department. When the report is finished, one of the members of the
upper management needs to approve the document before it is sent to all
the shareholders.
</para>
<para>
All files and code snippets used through the next sections can be found
in the <link linkend="examples">examples</link> shipped with the Activiti distribution.
Look for the package <emphasis>org.activiti.examples.bpmn.usertask</emphasis>.
</para>
</para>
</section>
......@@ -390,7 +378,7 @@ List&lt;Task&gt; tasks = taskService.createTaskQuery().taskCandidateGroup(&quot;
</para>
<para>
Since we've configured our ProcessEngine to use the same database as the demo setup is using (run the <link linkend="demo.setup">demo setup</link> if you haven't done it yet'),
Since we've configured our ProcessEngine to use the same database as the demo setup is using,
we can now log into <ulink url="http://localhost:8080/activiti-explorer/">Activiti Explorer</ulink>
(login with fozzie/fozzie), and we fill find that we can start our business process after
selecting the <emphasis>Processes</emphasis> page and
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "../../../target/docbook-tool-1.0/docbook-xml/docbookx.dtd">
<chapter>
<title>Activiti add-on components</title>
<section id="cycle">
<title>cycle</title>
<para>
Started off as Activiti Cycle and now moved to the <ulink url="http://www.camunda.com/fox">camunda fox BPM Platform</ulink>,
<ulink url="http://www.camunda.com/fox/enterprise/components/cycle/">Cycle</ulink> is web application that provides a
collaborative platform for different stakeholders
of BPM projects (Business, analysts, developers, managers, IT operations, ...).
It combines different data sources like Subversion or your local file system into a single view
which makes it easy to browse all the artifacts (process models, development projects, requirements, ...)
that are involved in such a project. Additionally you can maintain relationships between them and cycle
provides built in actions like moving artifacts between repositories or downloading different
formats of process models. A plug-in infrastructure is provided to hook in own repositories, actions or functionality.
</para>
<para>
The concept of Cycle, especially with the philosophy of Business-IT-Alignment is new. You might best compare it
to Application Lifecycle Management (ALM) tools. Cycle is developed by <ulink url="http://www.camunda.com">camunda</ulink>
and no longer aprt of the Activiti project.
</para>
</section>
</chapter>
......@@ -1466,7 +1466,6 @@
</listitem>
</itemizedlist>
</section>
</section>
<section>
<title>Search groups</title>
......@@ -1606,6 +1605,7 @@
</listitem>
</itemizedlist>
</section>
</section>
<!-- MANAGEMENT -->
......
......@@ -14,9 +14,8 @@
<!ENTITY ch11 SYSTEM "chapters/ch11-Designer.xml">
<!ENTITY ch12 SYSTEM "chapters/ch12-Explorer.xml">
<!ENTITY ch13 SYSTEM "chapters/ch13-Modeler.xml">
<!ENTITY ch14 SYSTEM "chapters/ch14-Addons.xml">
<!ENTITY ch15 SYSTEM "chapters/ch15-REST.xml">
<!ENTITY ch16 SYSTEM "chapters/ch16-Cdi.xml">
<!ENTITY ch14 SYSTEM "chapters/ch14-REST.xml">
<!ENTITY ch15 SYSTEM "chapters/ch15-Cdi.xml">
]>
<book>
......@@ -41,6 +40,5 @@
&ch13;
&ch14;
&ch15;
&ch16;
</book>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册