From 3b70b59e00cbac927766fc9f4c3f9831b0504f6a Mon Sep 17 00:00:00 2001 From: malithiperera Date: Thu, 27 Apr 2023 16:07:47 +0530 Subject: [PATCH 1/3] Inialize the Workflow Mediator --- .choreo/config-schema.json | 6 + .choreo/syntax-tree.json | 1 + .devcontainer.json | 4 + .vscode/launch.json | 32 ++++ Ballerina.toml | 12 ++ Cloud.toml | 4 + Config.toml | 13 ++ Dependencies.toml | 301 +++++++++++++++++++++++++++++++++++++ Package.md | 24 +++ camundaWorkflowEngine.bal | 82 ++++++++++ docs/icon.png | Bin 0 -> 4683 bytes target/build | 8 + workflowEngine.bal | 9 ++ workflowEngineFactory.bal | 9 ++ workflowMediator.bal | 72 +++++++++ 15 files changed, 577 insertions(+) create mode 100644 .choreo/config-schema.json create mode 100644 .choreo/syntax-tree.json create mode 100644 .devcontainer.json create mode 100644 .vscode/launch.json create mode 100644 Ballerina.toml create mode 100644 Cloud.toml create mode 100644 Config.toml create mode 100644 Dependencies.toml create mode 100644 Package.md create mode 100644 camundaWorkflowEngine.bal create mode 100644 docs/icon.png create mode 100644 target/build create mode 100644 workflowEngine.bal create mode 100644 workflowEngineFactory.bal create mode 100644 workflowMediator.bal diff --git a/.choreo/config-schema.json b/.choreo/config-schema.json new file mode 100644 index 0000000..5ba9e82 --- /dev/null +++ b/.choreo/config-schema.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": {}, + "additionalProperties": false +} diff --git a/.choreo/syntax-tree.json b/.choreo/syntax-tree.json new file mode 100644 index 0000000..6495177 --- /dev/null +++ b/.choreo/syntax-tree.json @@ -0,0 +1 @@ +{"ballerinaVersion":"2201.3.1","packageOrg":"malithiinternproject","packageName":"workflowextern_nq","packageVersion":"3.1.0","modules":{"workflowextern_nq":{"moduleName":"workflowextern_nq","documents":{"sample.bal":{"documentName":"sample.bal","syntaxTree":{"eofToken":{"isMissing":false,"isToken":true,"kind":"EofToken","leadingMinutiae":[],"position":{"endColumn":0,"endLine":14,"startColumn":0,"startLine":14},"trailingMinutiae":[],"value":""},"imports":[{"importKeyword":{"isMissing":false,"isToken":true,"kind":"ImportKeyword","leadingMinutiae":[],"position":{"endColumn":6,"endLine":0,"startColumn":0,"startLine":0},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"import"},"kind":"ImportDeclaration","leadingMinutiae":[],"moduleName":[{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":21,"endLine":0,"startColumn":17,"startLine":0},"trailingMinutiae":[],"value":"http"}],"orgName":{"kind":"ImportOrgName","leadingMinutiae":[],"orgName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":16,"endLine":0,"startColumn":7,"startLine":0},"trailingMinutiae":[],"value":"ballerina"},"position":{"endColumn":17,"endLine":0,"startColumn":7,"startLine":0},"slashToken":{"isMissing":false,"isToken":true,"kind":"SlashToken","leadingMinutiae":[],"position":{"endColumn":17,"endLine":0,"startColumn":16,"startLine":0},"trailingMinutiae":[],"value":"/"},"source":"ballerina/","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[]}},"position":{"endColumn":22,"endLine":0,"startColumn":0,"startLine":0},"semicolon":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":22,"endLine":0,"startColumn":21,"startLine":0},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":"import ballerina/http;\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"id":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"kind":"MODULE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"}}}}],"kind":"ModulePart","leadingMinutiae":[],"members":[{"kind":"TypeDefinition","leadingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"position":{"endColumn":2,"endLine":6,"startColumn":0,"startLine":2},"semicolonToken":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":2,"endLine":6,"startColumn":1,"startLine":6},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":"\ntype Greeting record {\n string 'from;\n string to;\n string message;\n};\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false}},"typeDescriptor":{"bodyEndDelimiter":{"isMissing":false,"isToken":true,"kind":"CloseBraceToken","leadingMinutiae":[],"position":{"endColumn":1,"endLine":6,"startColumn":0,"startLine":6},"trailingMinutiae":[],"value":"}"},"bodyStartDelimiter":{"isMissing":false,"isToken":true,"kind":"OpenBraceToken","leadingMinutiae":[],"position":{"endColumn":22,"endLine":2,"startColumn":21,"startLine":2},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":"{"},"fields":[{"fieldName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":16,"endLine":3,"startColumn":11,"startLine":3},"trailingMinutiae":[],"value":"'from"},"kind":"RecordField","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":17,"endLine":3,"startColumn":4,"startLine":3},"semicolonToken":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":17,"endLine":3,"startColumn":16,"startLine":3},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":" string 'from;\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string 'from"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}},"typeName":{"kind":"StringTypeDesc","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"name":{"isMissing":false,"isToken":true,"kind":"StringKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":10,"endLine":3,"startColumn":4,"startLine":3},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"string"},"position":{"endColumn":10,"endLine":3,"startColumn":4,"startLine":3},"source":" string ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"kind":"TYPE","signature":"string","typeKind":"string"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}},{"fieldName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":13,"endLine":4,"startColumn":11,"startLine":4},"trailingMinutiae":[],"value":"to"},"kind":"RecordField","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":14,"endLine":4,"startColumn":4,"startLine":4},"semicolonToken":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":14,"endLine":4,"startColumn":13,"startLine":4},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":" string to;\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string to"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}},"typeName":{"kind":"StringTypeDesc","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"name":{"isMissing":false,"isToken":true,"kind":"StringKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":10,"endLine":4,"startColumn":4,"startLine":4},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"string"},"position":{"endColumn":10,"endLine":4,"startColumn":4,"startLine":4},"source":" string ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"kind":"TYPE","signature":"string","typeKind":"string"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}},{"fieldName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":18,"endLine":5,"startColumn":11,"startLine":5},"trailingMinutiae":[],"value":"message"},"kind":"RecordField","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":19,"endLine":5,"startColumn":4,"startLine":5},"semicolonToken":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":19,"endLine":5,"startColumn":18,"startLine":5},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":" string message;\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string message"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}},"typeName":{"kind":"StringTypeDesc","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"name":{"isMissing":false,"isToken":true,"kind":"StringKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":10,"endLine":5,"startColumn":4,"startLine":5},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"string"},"position":{"endColumn":10,"endLine":5,"startColumn":4,"startLine":5},"source":" string ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"kind":"TYPE","signature":"string","typeKind":"string"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}}],"kind":"RecordTypeDesc","leadingMinutiae":[],"position":{"endColumn":1,"endLine":6,"startColumn":14,"startLine":2},"recordKeyword":{"isMissing":false,"isToken":true,"kind":"RecordKeyword","leadingMinutiae":[],"position":{"endColumn":20,"endLine":2,"startColumn":14,"startLine":2},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"record"},"source":"record {\n string 'from;\n string to;\n string message;\n}","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[]}},"typeKeyword":{"isMissing":false,"isToken":true,"kind":"TypeKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"position":{"endColumn":4,"endLine":2,"startColumn":0,"startLine":2},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"type"},"typeName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":13,"endLine":2,"startColumn":5,"startLine":2},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"Greeting"}},{"absoluteResourcePath":[{"isMissing":false,"isToken":true,"kind":"SlashToken","leadingMinutiae":[],"position":{"endColumn":9,"endLine":8,"startColumn":8,"startLine":8},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"/"}],"closeBraceToken":{"isMissing":false,"isToken":true,"kind":"CloseBraceToken","leadingMinutiae":[],"position":{"endColumn":1,"endLine":13,"startColumn":0,"startLine":13},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":"}"},"expressions":[{"kind":"ExplicitNewExpression","leadingMinutiae":[],"newKeyword":{"isMissing":false,"isToken":true,"kind":"NewKeyword","leadingMinutiae":[],"position":{"endColumn":16,"endLine":8,"startColumn":13,"startLine":8},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"new"},"parenthesizedArgList":{"arguments":[{"expression":{"kind":"NumericLiteral","leadingMinutiae":[],"literalToken":{"isMissing":false,"isToken":true,"kind":"DecimalIntegerLiteralToken","leadingMinutiae":[],"position":{"endColumn":35,"endLine":8,"startColumn":31,"startLine":8},"trailingMinutiae":[],"value":"8090"},"position":{"endColumn":35,"endLine":8,"startColumn":31,"startLine":8},"source":"8090","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"typeSymbol":{"kind":"TYPE","signature":"int","typeKind":"int"}}},"kind":"PositionalArg","leadingMinutiae":[],"position":{"endColumn":35,"endLine":8,"startColumn":31,"startLine":8},"source":"8090","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"typeSymbol":{"kind":"TYPE","signature":"int","typeKind":"int"}}}],"closeParenToken":{"isMissing":false,"isToken":true,"kind":"CloseParenToken","leadingMinutiae":[],"position":{"endColumn":36,"endLine":8,"startColumn":35,"startLine":8},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":")"},"kind":"ParenthesizedArgList","leadingMinutiae":[],"openParenToken":{"isMissing":false,"isToken":true,"kind":"OpenParenToken","leadingMinutiae":[],"position":{"endColumn":31,"endLine":8,"startColumn":30,"startLine":8},"trailingMinutiae":[],"value":"("},"position":{"endColumn":36,"endLine":8,"startColumn":30,"startLine":8},"source":"(8090) ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"typeSymbol":{"kind":"TYPE","members":[{"definition":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"signature":"Listener","typeKind":"object"},"kind":"TYPE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"name":"Listener","signature":"ballerina/http:2.5.2:Listener","typeKind":"typeReference"},{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"moduleQualifiedName":"http:ListenerError","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"name":"ListenerError","signature":"ballerina/http:2.5.2:ListenerError","typeKind":"typeReference"}],"signature":"ballerina/http:2.5.2:Listener|ballerina/http:2.5.2:ListenerError","typeKind":"union"}}},"position":{"endColumn":36,"endLine":8,"startColumn":13,"startLine":8},"source":"new http:Listener(8090) ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"typeSymbol":{"kind":"TYPE","members":[{"definition":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"signature":"Listener","typeKind":"object"},"kind":"TYPE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"name":"Listener","signature":"ballerina/http:2.5.2:Listener","typeKind":"typeReference"},{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"moduleQualifiedName":"http:ListenerError","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"name":"ListenerError","signature":"ballerina/http:2.5.2:ListenerError","typeKind":"typeReference"}],"signature":"ballerina/http:2.5.2:Listener|ballerina/http:2.5.2:ListenerError","typeKind":"union"}},"typeDescriptor":{"colon":{"isMissing":false,"isToken":true,"kind":"ColonToken","leadingMinutiae":[],"position":{"endColumn":22,"endLine":8,"startColumn":21,"startLine":8},"trailingMinutiae":[],"value":":"},"identifier":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":30,"endLine":8,"startColumn":22,"startLine":8},"trailingMinutiae":[],"value":"Listener"},"kind":"QualifiedNameReference","leadingMinutiae":[],"modulePrefix":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":21,"endLine":8,"startColumn":17,"startLine":8},"trailingMinutiae":[],"value":"http"},"position":{"endColumn":30,"endLine":8,"startColumn":17,"startLine":8},"source":"http:Listener","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"definition":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"signature":"Listener","typeKind":"object"},"kind":"TYPE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"name":"Listener","signature":"ballerina/http:2.5.2:Listener","typeKind":"typeReference"},"typeSymbol":{"definition":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"signature":"Listener","typeKind":"object"},"kind":"TYPE","moduleID":{"moduleName":"http","orgName":"ballerina","packageName":"http","version":"2.5.2"},"name":"Listener","signature":"ballerina/http:2.5.2:Listener","typeKind":"typeReference"}}}}],"kind":"ServiceDeclaration","leadingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"members":[{"functionBody":{"closeBraceToken":{"isMissing":false,"isToken":true,"kind":"CloseBraceToken","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":5,"endLine":12,"startColumn":4,"startLine":12},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":"}"},"kind":"FunctionBodyBlock","leadingMinutiae":[],"openBraceToken":{"isMissing":false,"isToken":true,"kind":"OpenBraceToken","leadingMinutiae":[],"position":{"endColumn":59,"endLine":9,"startColumn":58,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":"{"},"position":{"endColumn":5,"endLine":12,"startColumn":58,"startLine":9},"source":"{\n Greeting greetingMessage = {\"from\" : \"Choreo\", \"to\" : name, \"message\" : \"Welcome to Choreo!\"};\n return greetingMessage;\n }\n","statements":[{"annotations":[],"equalsToken":{"isMissing":false,"isToken":true,"kind":"EqualToken","leadingMinutiae":[],"position":{"endColumn":34,"endLine":10,"startColumn":33,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"="},"initializer":{"closeBrace":{"isMissing":false,"isToken":true,"kind":"CloseBraceToken","leadingMinutiae":[],"position":{"endColumn":101,"endLine":10,"startColumn":100,"startLine":10},"trailingMinutiae":[],"value":"}"},"fields":[{"colon":{"isMissing":false,"isToken":true,"kind":"ColonToken","leadingMinutiae":[],"position":{"endColumn":44,"endLine":10,"startColumn":43,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":":"},"fieldName":{"kind":"StringLiteral","leadingMinutiae":[],"literalToken":{"isMissing":false,"isToken":true,"kind":"StringLiteralToken","leadingMinutiae":[],"position":{"endColumn":42,"endLine":10,"startColumn":36,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"\"from\""},"position":{"endColumn":42,"endLine":10,"startColumn":36,"startLine":10},"source":"\"from\" ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string 'from"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}},"kind":"SpecificField","leadingMinutiae":[],"position":{"endColumn":53,"endLine":10,"startColumn":36,"startLine":10},"source":"\"from\" : \"Choreo\"","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string 'from"},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}},"valueExpr":{"kind":"StringLiteral","leadingMinutiae":[],"literalToken":{"isMissing":false,"isToken":true,"kind":"StringLiteralToken","leadingMinutiae":[],"position":{"endColumn":53,"endLine":10,"startColumn":45,"startLine":10},"trailingMinutiae":[],"value":"\"Choreo\""},"position":{"endColumn":53,"endLine":10,"startColumn":45,"startLine":10},"source":"\"Choreo\"","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}},{"isMissing":false,"isToken":true,"kind":"CommaToken","leadingMinutiae":[],"position":{"endColumn":54,"endLine":10,"startColumn":53,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":","},{"colon":{"isMissing":false,"isToken":true,"kind":"ColonToken","leadingMinutiae":[],"position":{"endColumn":61,"endLine":10,"startColumn":60,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":":"},"fieldName":{"kind":"StringLiteral","leadingMinutiae":[],"literalToken":{"isMissing":false,"isToken":true,"kind":"StringLiteralToken","leadingMinutiae":[],"position":{"endColumn":59,"endLine":10,"startColumn":55,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"\"to\""},"position":{"endColumn":59,"endLine":10,"startColumn":55,"startLine":10},"source":"\"to\" ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string to"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}},"kind":"SpecificField","leadingMinutiae":[],"position":{"endColumn":66,"endLine":10,"startColumn":55,"startLine":10},"source":"\"to\" : name","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string to"},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}},"valueExpr":{"kind":"SimpleNameReference","leadingMinutiae":[],"name":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":66,"endLine":10,"startColumn":62,"startLine":10},"trailingMinutiae":[],"value":"name"},"position":{"endColumn":66,"endLine":10,"startColumn":62,"startLine":10},"source":"name","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"kind":"PARAMETER","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string name"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}},{"isMissing":false,"isToken":true,"kind":"CommaToken","leadingMinutiae":[],"position":{"endColumn":67,"endLine":10,"startColumn":66,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":","},{"colon":{"isMissing":false,"isToken":true,"kind":"ColonToken","leadingMinutiae":[],"position":{"endColumn":79,"endLine":10,"startColumn":78,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":":"},"fieldName":{"kind":"StringLiteral","leadingMinutiae":[],"literalToken":{"isMissing":false,"isToken":true,"kind":"StringLiteralToken","leadingMinutiae":[],"position":{"endColumn":77,"endLine":10,"startColumn":68,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"\"message\""},"position":{"endColumn":77,"endLine":10,"startColumn":68,"startLine":10},"source":"\"message\" ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string message"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}},"kind":"SpecificField","leadingMinutiae":[],"position":{"endColumn":100,"endLine":10,"startColumn":68,"startLine":10},"source":"\"message\" : \"Welcome to Choreo!\"","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"hasDefaultValue":false,"isOptional":false,"kind":"RECORD_FIELD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string message"},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}},"valueExpr":{"kind":"StringLiteral","leadingMinutiae":[],"literalToken":{"isMissing":false,"isToken":true,"kind":"StringLiteralToken","leadingMinutiae":[],"position":{"endColumn":100,"endLine":10,"startColumn":80,"startLine":10},"trailingMinutiae":[],"value":"\"Welcome to Choreo!\""},"position":{"endColumn":100,"endLine":10,"startColumn":80,"startLine":10},"source":"\"Welcome to Choreo!\"","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}}],"kind":"MappingConstructor","leadingMinutiae":[],"openBrace":{"isMissing":false,"isToken":true,"kind":"OpenBraceToken","leadingMinutiae":[],"position":{"endColumn":36,"endLine":10,"startColumn":35,"startLine":10},"trailingMinutiae":[],"value":"{"},"position":{"endColumn":101,"endLine":10,"startColumn":35,"startLine":10},"source":"{\"from\" : \"Choreo\", \"to\" : name, \"message\" : \"Welcome to Choreo!\"}","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}}},"kind":"LocalVarDecl","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":102,"endLine":10,"startColumn":8,"startLine":10},"semicolonToken":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":102,"endLine":10,"startColumn":101,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":" Greeting greetingMessage = {\"from\" : \"Choreo\", \"to\" : name, \"message\" : \"Welcome to Choreo!\"};\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"kind":"VARIABLE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"}},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}},"typedBindingPattern":{"bindingPattern":{"kind":"CaptureBindingPattern","leadingMinutiae":[],"position":{"endColumn":32,"endLine":10,"startColumn":17,"startLine":10},"source":"greetingMessage ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"kind":"VARIABLE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"}},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}},"variableName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":32,"endLine":10,"startColumn":17,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"greetingMessage"}},"kind":"TypedBindingPattern","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":32,"endLine":10,"startColumn":8,"startLine":10},"source":" Greeting greetingMessage ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"kind":"VARIABLE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"}},"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}},"typeDescriptor":{"kind":"SimpleNameReference","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"name":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":16,"endLine":10,"startColumn":8,"startLine":10},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"Greeting"},"position":{"endColumn":16,"endLine":10,"startColumn":8,"startLine":10},"source":" Greeting ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}}}}},{"expression":{"kind":"SimpleNameReference","leadingMinutiae":[],"name":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":30,"endLine":11,"startColumn":15,"startLine":11},"trailingMinutiae":[],"value":"greetingMessage"},"position":{"endColumn":30,"endLine":11,"startColumn":15,"startLine":11},"source":"greetingMessage","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"kind":"VARIABLE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"}},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}}},"kind":"ReturnStatement","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":31,"endLine":11,"startColumn":8,"startLine":11},"returnKeyword":{"isMissing":false,"isToken":true,"kind":"ReturnKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":14,"endLine":11,"startColumn":8,"startLine":11},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"return"},"semicolonToken":{"isMissing":false,"isToken":true,"kind":"SemicolonToken","leadingMinutiae":[],"position":{"endColumn":31,"endLine":11,"startColumn":30,"startLine":11},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":";"},"source":" return greetingMessage;\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}}}],"syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}}},"functionKeyword":{"isMissing":false,"isToken":true,"kind":"FunctionKeyword","leadingMinutiae":[],"position":{"endColumn":21,"endLine":9,"startColumn":13,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"function"},"functionName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":25,"endLine":9,"startColumn":22,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"get"},"functionSignature":{"closeParenToken":{"isMissing":false,"isToken":true,"kind":"CloseParenToken","leadingMinutiae":[],"position":{"endColumn":40,"endLine":9,"startColumn":39,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":")"},"kind":"FunctionSignature","leadingMinutiae":[],"openParenToken":{"isMissing":false,"isToken":true,"kind":"OpenParenToken","leadingMinutiae":[],"position":{"endColumn":28,"endLine":9,"startColumn":27,"startLine":9},"trailingMinutiae":[],"value":"("},"parameters":[{"annotations":[],"kind":"RequiredParam","leadingMinutiae":[],"paramName":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":39,"endLine":9,"startColumn":35,"startLine":9},"trailingMinutiae":[],"value":"name"},"position":{"endColumn":39,"endLine":9,"startColumn":28,"startLine":9},"source":"string name","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[],"symbol":{"kind":"PARAMETER","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"string name"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}},"typeName":{"kind":"StringTypeDesc","leadingMinutiae":[],"name":{"isMissing":false,"isToken":true,"kind":"StringKeyword","leadingMinutiae":[],"position":{"endColumn":34,"endLine":9,"startColumn":28,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"string"},"position":{"endColumn":34,"endLine":9,"startColumn":28,"startLine":9},"source":"string ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"kind":"TYPE","signature":"string","typeKind":"string"},"typeSymbol":{"kind":"TYPE","signature":"string","typeKind":"string"}}}}],"position":{"endColumn":57,"endLine":9,"startColumn":27,"startLine":9},"returnTypeDesc":{"annotations":[],"kind":"ReturnTypeDescriptor","leadingMinutiae":[],"position":{"endColumn":57,"endLine":9,"startColumn":41,"startLine":9},"returnsKeyword":{"isMissing":false,"isToken":true,"kind":"ReturnsKeyword","leadingMinutiae":[],"position":{"endColumn":48,"endLine":9,"startColumn":41,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"returns"},"source":"returns Greeting ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"type":{"kind":"SimpleNameReference","leadingMinutiae":[],"name":{"isMissing":false,"isToken":true,"kind":"IdentifierToken","leadingMinutiae":[],"position":{"endColumn":57,"endLine":9,"startColumn":49,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"Greeting"},"position":{"endColumn":57,"endLine":9,"startColumn":49,"startLine":9},"source":"Greeting ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"symbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"},"typeSymbol":{"definition":{"deprecated":false,"kind":"TYPE_DEFINITION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"moduleQualifiedName":"workflowextern_nq:Greeting","readonly":false},"kind":"TYPE","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"name":"Greeting","signature":"malithiinternproject/workflowextern_nq:3.1.0:Greeting","typeKind":"typeReference"}}},"typeData":{"diagnostics":[],"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}}},"source":"(string name) returns Greeting ","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"typeData":{"diagnostics":[],"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}}},"kind":"ResourceAccessorDefinition","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":5,"endLine":12,"startColumn":4,"startLine":9},"qualifierList":[{"isMissing":false,"isToken":true,"kind":"ResourceKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"position":{"endColumn":12,"endLine":9,"startColumn":4,"startLine":9},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"resource"}],"relativeResourcePath":[{"isMissing":false,"isToken":true,"kind":"DotToken","leadingMinutiae":[],"position":{"endColumn":27,"endLine":9,"startColumn":26,"startLine":9},"trailingMinutiae":[],"value":"."}],"source":" resource function get .(string name) returns Greeting {\n Greeting greetingMessage = {\"from\" : \"Choreo\", \"to\" : name, \"message\" : \"Welcome to Choreo!\"};\n return greetingMessage;\n }\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"deprecated":false,"external":false,"kind":"RESOURCE_METHOD","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting"},"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}}}],"onKeyword":{"isMissing":false,"isToken":true,"kind":"OnKeyword","leadingMinutiae":[],"position":{"endColumn":12,"endLine":8,"startColumn":10,"startLine":8},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"on"},"openBraceToken":{"isMissing":false,"isToken":true,"kind":"OpenBraceToken","leadingMinutiae":[],"position":{"endColumn":38,"endLine":8,"startColumn":37,"startLine":8},"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"value":"{"},"position":{"endColumn":1,"endLine":13,"startColumn":0,"startLine":8},"qualifiers":[],"serviceKeyword":{"isMissing":false,"isToken":true,"kind":"ServiceKeyword","leadingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"position":{"endColumn":7,"endLine":8,"startColumn":0,"startLine":8},"trailingMinutiae":[{"isInvalid":false,"kind":"WHITESPACE_MINUTIAE","minutiae":" "}],"value":"service"},"source":"\nservice / on new http:Listener(8090) {\n resource function get .(string name) returns Greeting {\n Greeting greetingMessage = {\"from\" : \"Choreo\", \"to\" : name, \"message\" : \"Welcome to Choreo!\"};\n return greetingMessage;\n }\n}\n","syntaxDiagnostics":[],"trailingMinutiae":[{"isInvalid":false,"kind":"END_OF_LINE_MINUTIAE","minutiae":"\n"}],"typeData":{"diagnostics":[],"symbol":{"kind":"SERVICE_DECLARATION","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"}},"typeSymbol":{"deprecated":false,"kind":"CLASS","moduleID":{"moduleName":"workflowextern_nq","orgName":"malithiinternproject","packageName":"workflowextern_nq","version":"3.1.0"},"signature":"isolated service object {isolated resource function get . (string name) returns malithiinternproject/workflowextern_nq:3.1.0:Greeting;}","typeKind":"object"}}}],"position":{"endColumn":1,"endLine":13,"startColumn":0,"startLine":0},"source":"import ballerina/http;\n\ntype Greeting record {\n string 'from;\n string to;\n string message;\n};\n\nservice / on new http:Listener(8090) {\n resource function get .(string name) returns Greeting {\n Greeting greetingMessage = {\"from\" : \"Choreo\", \"to\" : name, \"message\" : \"Welcome to Choreo!\"};\n return greetingMessage;\n }\n}\n","syntaxDiagnostics":[],"trailingMinutiae":[],"typeData":{"diagnostics":[]}}}}}}} \ No newline at end of file diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000..ee6f540 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,4 @@ +{ + "image": "ballerina/ballerina-devcontainer:2201.3.1", + "extensions": ["WSO2.ballerina"], +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..cb76921 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Ballerina Debug", + "type": "ballerina", + "request": "launch", + "programArgs": [], + "commandOptions": [], + "env": {} + }, + { + "name": "Ballerina Test", + "type": "ballerina", + "request": "launch", + "debugTests": true, + "programArgs": [], + "commandOptions": [], + "env": {} + }, + { + "name": "Ballerina Remote", + "type": "ballerina", + "request": "attach", + "debuggeeHost": "127.0.0.1", + "debuggeePort": "5005" + } + ] +} \ No newline at end of file diff --git a/Ballerina.toml b/Ballerina.toml new file mode 100644 index 0000000..9e62831 --- /dev/null +++ b/Ballerina.toml @@ -0,0 +1,12 @@ +[build-options] + observabilityIncluded = true + +[package] + distribution = "2201.3.1" + export = ["workflowextern_nq"] + icon = "docs/icon.png" + keywords = ["Kind/Sample","Type/RestApi","Category/Service","Internal/http"] + name = "workflowextern_nq" + org = "malithiinternproject" + version = "3.1.0" + diff --git a/Cloud.toml b/Cloud.toml new file mode 100644 index 0000000..09831ec --- /dev/null +++ b/Cloud.toml @@ -0,0 +1,4 @@ +[settings] + buildImage = false + thinJar = false + diff --git a/Config.toml b/Config.toml new file mode 100644 index 0000000..66e0af8 --- /dev/null +++ b/Config.toml @@ -0,0 +1,13 @@ +#Provide the workflow engine configuration details here + +#engine_type = Exetrnal workflow engine type +#engine_url = External workflow engine url +[workflow_engine_config] +engine_type = "camunda" +engine_url = "http://localhost:8080/engine-rest/process-definition" + +#callback_url = Callback url for the identity server to call back after the workflow completion +[callback] +callback_url = "http://localhost:9763/api/server/v1/workflow/" + + diff --git a/Dependencies.toml b/Dependencies.toml new file mode 100644 index 0000000..b2fdc1d --- /dev/null +++ b/Dependencies.toml @@ -0,0 +1,301 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "regex"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.2.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.0.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.2.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.4.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "regex"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.4.6" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "regex"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.3.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] +modules = [ + {org = "ballerina", packageName = "io", moduleName = "io"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "regex"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.4.1" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"} +] +modules = [ + {org = "ballerina", packageName = "mime", moduleName = "mime"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.4.1" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.0.6" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.4.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "regex" +version = "1.3.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.string"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.2.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.2.4" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.2.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerinai" +name = "observe" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "observe"} +] +modules = [ + {org = "ballerinai", packageName = "observe", moduleName = "observe"} +] + +[[package]] +org = "malithiinternproject" +name = "workflowextern_nq" +version = "3.1.0" +dependencies = [ + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "mime"}, + {org = "ballerinai", name = "observe"} +] +modules = [ + {org = "malithiinternproject", packageName = "workflowextern_nq", moduleName = "workflowextern_nq"} +] + + diff --git a/Package.md b/Package.md new file mode 100644 index 0000000..12e34d8 --- /dev/null +++ b/Package.md @@ -0,0 +1,24 @@ +Use template (Greetings) to respond with a record via an HTTP GET. + +## Use case +When the service is invoked with a message, the service will respond with a record including that message received via an HTTP GET. + +## Prerequisites +* Pull the template from central +`bal new -t choreo/greeting_service ` + +## Run the template +Run the Ballerina project created by the service template by executing `bal run` from the root. + +Once successfully executed, Listener will be started at port 8090. Then you need to invoke the service using the following curl command +``` +$ curl http://localhost:8090?name=John +``` +Now service will be invoked and returns record as +``` + { + from: "Choreo" + to: "John" + message: "Welcome to Choreo!" + } +``` diff --git a/camundaWorkflowEngine.bal b/camundaWorkflowEngine.bal new file mode 100644 index 0000000..455c0e3 --- /dev/null +++ b/camundaWorkflowEngine.bal @@ -0,0 +1,82 @@ + +import ballerina/http; +import ballerina/io; + +//Camunda Records + +type CamundaInputTypeVariable record { + string name; + string value; +}; + +type CamundaOutputTypeVariable record { + string value; +}; + +type CamundaOutputType record { + map variables; +}; + + +type CamundaConfig record {| +string engine_type; +string engine_url; + +|}; + +configurable CamundaConfig workflow_engine_config = ?; + + +distinct service class CamundaWorkflowEngine { + + *WorkflowEngine; + + private string engineURL; + + + function init() { + self.engineURL = workflow_engine_config.engine_url; + + } + + # Description + # + # + workflowRequestType - Parameter Description + # + return - Return Value Description + public function workflowInitializer(WorkflowRequest workflowRequestType) returns error? { + + string workflowDefinitionID = workflowRequestType.workflow_id; + http:Client clientCamunda = check new (self.engineURL); + CamundaOutputType camundaPayload = check self.CamundaConvert(workflowRequestType); + io:println("Camunda Payload: ", camundaPayload); + http:Response _ = check clientCamunda->post("/" + workflowDefinitionID + "/start", camundaPayload, {}); + + + } + # Description + # the requrst json payload converts the data format whih except from camunda engine + # + workflowRequestType - json data format. + # + return - requset type json data format. + # + private isolated function CamundaConvert(WorkflowRequest workflowRequestType) returns error|CamundaOutputType { + + string camundaWorkflowID = workflowRequestType.request_id; + + CamundaOutputType outputType = { + variables: {} + }; + outputType.variables["requestID"] = { + value: camundaWorkflowID + }; + foreach CamundaInputTypeVariable inputVariable in workflowRequestType.workflow_parameters { + + outputType.variables[inputVariable.name] = { + value: inputVariable.value + + }; + + } + return outputType; + } + +} diff --git a/docs/icon.png b/docs/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9ee069fe87fce0182ed30b2c8e251dde67ff8066 GIT binary patch literal 4683 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 headers = {"Content-Type": mime:APPLICATION_JSON}; + http:Response res = check CallbackIS->patch(requestID, payload, headers); + + check caller->respond(res.statusCode); + + } + +} + From e6a846dff75db8abcccf12d3cb7f05d053aca4d0 Mon Sep 17 00:00:00 2001 From: malithiperera Date: Fri, 28 Apr 2023 10:47:57 +0530 Subject: [PATCH 2/3] update changes --- Dependencies.toml | 4 ---- README.md | 9 +++++++++ camundaWorkflowEngine.bal | 12 +++++++----- target/build | 4 ++-- workflowMediator.bal | 30 +++++++++++++++--------------- 5 files changed, 33 insertions(+), 26 deletions(-) diff --git a/Dependencies.toml b/Dependencies.toml index b2fdc1d..2650295 100644 --- a/Dependencies.toml +++ b/Dependencies.toml @@ -98,9 +98,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] -modules = [ - {org = "ballerina", packageName = "io", moduleName = "io"} -] [[package]] org = "ballerina" @@ -290,7 +287,6 @@ name = "workflowextern_nq" version = "3.1.0" dependencies = [ {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, {org = "ballerina", name = "mime"}, {org = "ballerinai", name = "observe"} ] diff --git a/README.md b/README.md index 0f93980..be0bd97 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # workflow-mediator Workflow mediator implementation in Ballerina + +# Description +Workflow mediator is a ballerina service which mediate the WSO2 IS and the external workflow engine. + +# Implementation +Initially we developed the mediation process for camunda external bps engine. + + + diff --git a/camundaWorkflowEngine.bal b/camundaWorkflowEngine.bal index 455c0e3..6e29adb 100644 --- a/camundaWorkflowEngine.bal +++ b/camundaWorkflowEngine.bal @@ -1,6 +1,7 @@ import ballerina/http; -import ballerina/io; + + //Camunda Records @@ -45,11 +46,12 @@ distinct service class CamundaWorkflowEngine { # + return - Return Value Description public function workflowInitializer(WorkflowRequest workflowRequestType) returns error? { - string workflowDefinitionID = workflowRequestType.workflow_id; + string workflowDefinitionID = workflowRequestType.workflowID; http:Client clientCamunda = check new (self.engineURL); CamundaOutputType camundaPayload = check self.CamundaConvert(workflowRequestType); - io:println("Camunda Payload: ", camundaPayload); + http:Response _ = check clientCamunda->post("/" + workflowDefinitionID + "/start", camundaPayload, {}); + } @@ -60,7 +62,7 @@ distinct service class CamundaWorkflowEngine { # private isolated function CamundaConvert(WorkflowRequest workflowRequestType) returns error|CamundaOutputType { - string camundaWorkflowID = workflowRequestType.request_id; + string camundaWorkflowID = workflowRequestType.requestID; CamundaOutputType outputType = { variables: {} @@ -68,7 +70,7 @@ distinct service class CamundaWorkflowEngine { outputType.variables["requestID"] = { value: camundaWorkflowID }; - foreach CamundaInputTypeVariable inputVariable in workflowRequestType.workflow_parameters { + foreach CamundaInputTypeVariable inputVariable in workflowRequestType.workflowVariable { outputType.variables[inputVariable.name] = { value: inputVariable.value diff --git a/target/build b/target/build index 86dbeb9..78e07f4 100644 --- a/target/build +++ b/target/build @@ -1,8 +1,8 @@ { - "last_build_time": 1682591438169, + "last_build_time": 1682605492671, "last_update_time": 1682591438169, "distribution_version": "2201.2.3", "last_modified_time": { - "workflowextern_nq": 1682580605194 + "workflowextern_nq": 1682605480541 } } diff --git a/workflowMediator.bal b/workflowMediator.bal index b255a49..b4a24bb 100644 --- a/workflowMediator.bal +++ b/workflowMediator.bal @@ -3,7 +3,7 @@ import ballerina/mime; //callback record -type CallbackCamunda record { +type CallbackPayload record { string requestID; string status; @@ -20,13 +20,13 @@ public type WorkflowRequestParamter record { # Description # -# + request_id - Request Idenitifier and this use for callback function -# + workflow_id - External workflow Identifier -# + workflow_parameters - List of varibles which recived from the request +# + requestId - Request Idenitifier and this use for callback function +# + workflowId - External workflow Identifier +# + workflowVariable - List of varibles which recived from the request public type WorkflowRequest record { - string request_id; - string workflow_id; - WorkflowRequestParamter[] workflow_parameters; + string requestID; + string workflowID; + WorkflowRequestParamter[] workflowVariable; }; type WorkflowEngineType record { string TYPE; @@ -44,25 +44,25 @@ service / on new http:Listener(8090) { WorkflowEngine workflowEngine = check createWorkflowEngine(workflow_engine_config.engine_type); error? workflowInitializer = workflowEngine.workflowInitializer(workflowRequestType); if workflowInitializer is error { - + return workflowInitializer; } + check caller->respond(200); - - } resource function post Callback(http:Caller caller, http:Request request) returns error? { + http:Client CallbackIS = check new (callback.callback_url); json callbackPayload = check request.getJsonPayload(); - CallbackCamunda inputRecord = check callbackPayload.cloneWithType(CallbackCamunda); - string requestID = inputRecord.requestID; - json payload = { - "status": inputRecord.status + CallbackPayload callbackpayload = check callbackPayload.cloneWithType(CallbackPayload); + string requestID = callbackpayload.requestID; + json ISCallbackPayload = { + "status": callbackpayload.status }; map headers = {"Content-Type": mime:APPLICATION_JSON}; - http:Response res = check CallbackIS->patch(requestID, payload, headers); + http:Response res = check CallbackIS->patch(requestID, ISCallbackPayload, headers); check caller->respond(res.statusCode); From 9756c9065ca348c5f767e53c115f66080cb5b961 Mon Sep 17 00:00:00 2001 From: malithiperera Date: Fri, 28 Apr 2023 12:35:08 +0530 Subject: [PATCH 3/3] edit class comments --- workflowMediator.bal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflowMediator.bal b/workflowMediator.bal index b4a24bb..063d4e1 100644 --- a/workflowMediator.bal +++ b/workflowMediator.bal @@ -20,8 +20,8 @@ public type WorkflowRequestParamter record { # Description # -# + requestId - Request Idenitifier and this use for callback function -# + workflowId - External workflow Identifier +# + requestID - Request Idenitifier and this use for callback function +# + workflowID - External workflow Identifier # + workflowVariable - List of varibles which recived from the request public type WorkflowRequest record { string requestID;