Skip to content

Instantly share code, notes, and snippets.

View tsurdilo's full-sized avatar

Tihomir Surdilovic tsurdilo

View GitHub Profile
{
"id": "VetAppointmentWorkflow",
"description": "Vet service call via events",
"version": "1.0",
"functions": [
{
"name": "VetAppointmentService",
"triggerEventRef": "MakeVetAppointment",
"resultEventRef": "VetAppointmentInfo"
}
Function definitions allows you to define invocation information of services that need to be invoked during
workflow execution.
They can be referenced by name in [actions](#Action-Definition) defined in [Event](#Event-State), [Operation](#Operation-State), or [Callback](#Callback-State) workflow states.
There are two possible ways to define service infocation information:
* Via the 'resource' properties which defines the exposed URI of the service that allows its invocation via REST for example.
The results of the service execution in this case are assumed to be present in the REST call response.
* Via the 'triggerEventRef' and 'resultEventRef' properties. In this scenario the defined function is invoked by the referenced
trigger event and its results can be obtained in the payload body of the referenced result event. Note that since there can be
/*
* Copyright 2018-Present The Serverless Workflow Specification Authors
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
<bpmn2:serviceTask id="ServiceTask_1" name="Find user" implementation="Java" operationRef="Operation_1">
<bpmn2:extensionElements>
<tns:metaData name="elementname">
<tns:metaValue><![CDATA[Find user]]></tns:metaValue>
</tns:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
<bpmn2:ioSpecification id="InputOutputSpecification_12">
<bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_90" name="endpoint"/>
"functions": [
{
"name": "ApplicantDecisionEvent",
"source": "decision",
"type": "knative"
}
]
(...)
"states": [
{
{"data":{"name":"john"}, "kogitoProcessId":"testtransitionevent","kogitoProcessinstanceId":"1d181fef-af8e-4f0c-b349-e371b5ddb55c"}
{"data":{"name":"john"}, "kogitoProcessId":"testtransitionevent","kogitoReferenceId":"405287af-3eb2-4a03-b664-3efea7c65cee"}
{"data":{"name":"john"},"kogitoReferenceId":"ea51fb91-4e3f-4115-93fc-b20622c2aa12"}
1d181fef-af8e-4f0c-b349-e371b5ddb55c
org.jbpm.ruleflow.core.factory.EventNodeFactory eventNode4 = factory.eventNode(4);
eventNode4.name("visasapproved");
eventNode4.eventType("Message-visasapproved");
eventNode4.variableName("visaApplication");
eventNode4.metaData("UniqueId", "_7F75E8BD-3032-47EC-814F-66B197CA99C5");
eventNode4.metaData("elementname", "visasapproved");
eventNode4.metaData("TriggerType", "ConsumeMessage");
eventNode4.metaData("EventType", "message");
eventNode4.metaData("x", 690);
eventNode4.metaData("width", 56);
@tsurdilo
tsurdilo / gist:018a330917ec56ce9c7729ac08edfde2
Created May 26, 2020 01:46
Handling Errors in Parallel state (1)
---
id: errorInParallelState
name: Error In Parallel State
version: '1.0'
functions:
- name: ThrowsErrorFunction
resource: throwErrorFunctionResource
states:
- name: parallelState
type: parallel
xmlns:zeebe="http://camunda.org/schema/zeebe/1.0"
xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
https://github.com/SAP-samples/cloud-workflow-samples/blob/master/onboarding-sample/workflowmodel/SFSFOnboardingWorkflow/workflows/SuccessFactorsOnboarding.workflow
/*
* Copyright 2020 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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,