BPM-Engine
view release on metacpan or search on metacpan
Creates a new process instance, given a process id or
BPM::Engine::Store::Result::Process row object and an optional hash of
process instance properties.
Of these process instance properties, "instance_name" is useful to
specify a name for the instance. A name will be auto-generated if not
specified.
Returns the BPM::Engine::Store::Result::ProcessInstance that was
created.
start_process_instance
$engine->start_process_instance($pi_id);
* Arguments: $process_instance_id | ProcessInstanceRow, \%attrs?
* Returns: void
Starts to run a process instance given a process instance object or id,
and an optional hash of process instance attributes.
delete_process_instance
$engine->delete_process_instance($pi_id);
* Arguments: $process_instance_id | ProcessInstanceRow |
\%columns_values
* Returns: ProcessInstanceRow
Takes a process instance id or a process instance object, and deletes
the process instance from the data store.
An exception is thrown if the process instance is not found in the data
store.
process_instance_attribute
$attr = $engine->process_instance_attribute($pi_id, 'some_var');
$attr = $engine->process_instance_attribute($pi_id, 'some_var', 'new_value');
* Arguments: $process_instance_id | ProcessInstanceRow |
\%columns_values, $attribute_name, $attribute_value?
* Returns: ProcessInstanceAttributeRow
Gets or sets a process instance attribute.
change_process_instance_state
$engine->change_process_instance_state($pi_id, 'abort');
* Arguments: $process_instance_id | ProcessInstanceRow |
\%columns_values, $state_transition
* Returns: ProcessInstanceRow
Sets the new state of the process instance given a process instance id
or a process instance object and a state transition name.
The following state transitions are possible:
start
Changes the process instance state from "open.not_running.ready" to
"open.running".
suspend
Changes the process instance state from "open.running" to
"open.not_running.suspended".
resume
Changes the process instance state from "open.not_running.suspended"
to "open.running".
terminate
Changes the process instance state from "open.not_running.ready",
"open.running" or "open.not_running.suspended" to
"closed.cancelled.terminated". This is an end state (no more state
transitions possible).
abort
Changes the process instance state from "open.not_running.ready",
"open.running" or "open.not_running.suspended" to
"closed.cancelled.aborted". This is an end state (no more state
transitions possible).
finish
Changes the process instance state from "open.running" to
"closed.completed". This is an end state (no more state transitions
possible).
An exception will be thrown for invalid state transitions, for example
when the process instance is not in the right state to allow the
transition.
ACTIVITY INSTANCE METHODS
get_activity_instances
$rs = $engine->get_activity_instances();
* Arguments: $cond?, \%attrs?
* Returns: $resultset
Get a DBIx::Class::ResultSet of
BPM::Engine::Store::Result::ActivityInstance rows. Takes the same
arguments as the DBIx::Class::ResultSet "search()" method.
get_activity_instance
$ai = $engine->get_activity_instance($aid);
* Arguments: \%columns_values | $activity_instance_id, \%attrs?
* Returns: ActivityInstanceRow
Takes an activity instance id or a hashref and optional standard
DBIC resultset attributes and returns the corresponding
BPM::Engine::Store::Result::ActivityInstance row. Delegates to
DBIx::Class::ResultSet's "find()" method.
change_activity_instance_state
$engine->change_activity_instance_state($aid, 'finish');
* Arguments: $activity_instance_id | ActivityInstanceRow |
\%columns_values, $state_transition
* Returns: ActivityInstanceRow
Sets the new state of the activity instance given a activity instance id
or a activity instance object and a state transition name.
The following state transitions are possible:
start
Changes the activity instance state from "open.not_running.ready" to
"open.running.not_assigned".
assign
Changes the activity instance state from "open.not_running.ready" or
"open.running.not_assigned" to "open.running.assigned".
reassign
Valid state transition when the activity instance state is
"open.running.assigned". Does not actually change the state.
unassign
Changes the activity instance state from "open.running.assigned" to
"open.running.not_assigned".
suspend
Changes the activity instance state from "open.running.assigned" to
"open.not_running.suspended".
resume
Changes the activity instance state from
"open.not_running.suspended" to "open.running.assigned".
abort
Changes the activity instance state from "open.not_running.ready" or
"open.running.assigned" to "closed.cancelled.aborted". This is an
end state (no more state transitions possible).
finish
Changes the activity instance state from "open.not_running.ready" or
"open.running.assigned" to "closed.completed". This is an end state
(no more state transitions possible).
activity_instance_attribute
$attr = $engine->activity_instance_attribute($ai_id, 'some_var');
$attr = $engine->activity_instance_attribute($ai_id, 'some_var', 'new_value');
* Arguments: $activity_instance_id | ActivityInstanceRow |
\%columns_values, $attribute_name, $attribute_value?
* Returns: ActivityInstanceAttributeRow
Gets or sets an activity instance attribute, and returns the
corresponding ActivityInstanceAttribute row.
LOGGING METHODS
$engine->debug('Some thing did a thing');
The following methods of the attached logger object are available to the
engine: log, debug, info, notice, warning, error, critical, alert,
emergency
INTERNAL METHODS
runner
$runner = $engine->runner($process_instance);
Returns a new BPM::Engine::ProcessRunner instance with the
"runner_traits" and "callback" attribute applied for the specified
process instance. Internal method, used by "start_process_instance()"
and "change_activity_instance_state()" to advance a process instance.
DIAGNOSTICS
Exception Handling
When "BPM::Engine" encounters an API error, it throws a
"BPM::Engine::Exception" object. You can catch and process these
exceptions, see BPM::Engine::Exception for more information.
CONFIGURATION AND ENVIRONMENT
BPM::Engine may optionally be configured with a configuration file when
constructed using the "new_with_config" method. See etc/engine.yaml for
an example.
MAJOR DEPENDENCIES
* Moose
* Class::Workflow
* BPM::XPDL
* DBIx::Class
* Template Toolkit
* Text::Xslate
* XML::LibXML
* Graph
See the included Makefile.PL for a list of all dependencies.
( run in 0.865 second using v1.01-cache-2.11-cpan-39bf76dae61 )